Trait variation within species is shaped by the genotype and the environment an individual is exposed to. Genomic information is inherited from the parents and forms the basis of the phenotype of an organism. The genetic variation between parents becomes differently distributed between their offspring, leading to trait variation in the offspring. Each trait can be affected by many genes, therefore the genetic architecture can be complex. In complex traits, multiple loci contribute to the ultimate trait value. However, complex traits are shaped not only by genetic variation but also by the environment and the interaction between genotype and environment. The interplay between genetic and environmental variation can affect the fitness of an organism. Chapter 2 discusses how genotype and environment have shaped the phenotype of the nematode Caenorhabditis elegans, the model species used in this thesis, resulting in a laboratory adapted domesticized strain known as Bristol N2. Bristol N2 has been cultivated in the laboratory for over a decade, leading to the fixation of novel mutations in several genes that strongly affect its phenotype. Genotypic variation arisen by novel mutations in the genes npr-1, glb-5, and nath-10 was fixed in N2 due to the laboratory environment. The allelic variation in npr-1 affects the behaviour of this animal in an environment dependent manner, showcasing the interplay between genotype and environment. However, the altered behaviour warrants caution for interpretation of results obtained in the N2 strain. The genotypic effects on trait variation can be large, and one of the more powerful population designs to study these effects are introgression lines. In chapter 3 the construction of a genome-wide introgression line (IL) panel between the N2 and the CB4856 strain is described. This panel contains loci of N2 introgressed in a homogeneous CB4856 background. It is demonstrated that together with CB4856-in-N2 ILs this new genome-wide introgression line library strongly facilitates the dissection of genetic interactions. Chapter 4 and 5 investigate natural variation in infection with Orsay virus, a natural pathogen of the nematode C. elegans. In chapter 4 an assay is developed and tested on two wild-type strains (N2 and JU1580) and two mutant strains with mutations in the RNAi pathway. The development of the virus infection in the separate strains can be traced and the influence of genotype and age on the progression of the infection can be quantified. Furthermore, it is demonstrated that heritable RNAi plays a role in the viral load upon Orsay virus infection, an example of an epigenetically inherited environmental influence. In chapter 5 the assay is applied on an N2xCB4856 recombinant inbred line (RIL) population, after observing a lower viral load in CB4856 compared to N2. The RIL analysis resulted in the identification of two QTL on chromosome IV. These quantitative trait loci (QTL) were verified by CB4856-in-N2 ILs, but the IL analysis also indicated that there could be genetic interactions affecting the QTL. By a transcriptome analysis and a candidate gene search, the gene cul-6 was identified as a candidate underlying the allelic variation between the N2 and CB4856 strain. Chapters 6 and 7 investigate the influence of genetic interactions and the environment on the genetic architecture of gene expression. In chapter 6 a N2xCB4856 RIL population was exposed to heat stress, leading to the identification of a trans-band on the top of chromosome IV. By analysis of candidate genes, cmk-1, egl-4, and eor-1 were implicated as contributing to the heat-stress induced transcriptional response affected by natural variation between N2 and CB4856. Furthermore, the genes with an expression-QTL on the trans-band were indicative of a stress response phenotype. By analysis of CB4856-in-N2 ILs, it was found that this locus leads to increased recovery from stress. In chapter 7 two-loci genetic interactions were mapped for gene expression in a N2xCB4856 RIL panel. These epistatic interactions were confirmed by measuring gene expression in a novel population of inbred line containing the full set of loci combinations. It was found that genetic interactions in gene expression can be identified by clustering and are pervasive. These genetically interacting loci affect evolutionary conserved genes. In conclusion, this thesis unveils the mechanisms underlying the genetic architecture of complex traits in C. elegans resulting from genotype and interactions between genotype and environment. It provides tools to unravel these interactions in C. elegans, by providing the community with new resources such as the N2-in-CB4856 introgression lines. Although C. elegans has been a very powerful platform for quantitative trait dissection, we need to expand our mechanistic understanding of polygenic traits.