Genotype by environment interactions (GEI) play a major part in shaping the genetic architecture of quantitative traits and are confounding factors in genetic studies, for example, in attempts to associate genetic variation with disease susceptibility. It is generally not known what proportion of phenotypic variation is due to GEI and how many and which genes contribute to GEI. Behaviors are complex traits that mediate interactions with the environment and, thus, are ideally suited for studies of GEI. Olfactory behavior in Drosophila melanogaster presents an opportunity to systematically dissect GEI, since large numbers of genetically identical individuals can be reared under defined environmental conditions and the olfactory system of Drosophila and its behavioral response to odorants have been well characterized. We assessed variation in olfactory behavior in a population of 41 wild-derived inbred lines and asked to what extent different larval-rearing environments would influence adult olfactory behavior and whether GEI is a minor or major contributing source of phenotypic variation. We found that approximately 50% of phenotypic variation in adult olfactory behavior is attributable to GEI. In contrast, transcriptional analysis revealed that only 20 genes show GEI at the level of gene expression [false discovery rate (FDR) < 0.05], some of which are associated with physiological responses to environmental chemicals. Quantitative complementation tests with piggyBac-tagged mutants for 2 of these genes (CG9664 and Transferrin 1) demonstrate that genes that show transcriptional GEI are candidate genes for olfactory behavior and that GEI at the level of gene expression is correlated with GEI at the level of phenotype.