Phenotypic variation of quantitative traits is orchestrated by a complex interplay between the environment (e.g. diet) and genetics. However, the impact of gene-environment interactions on phenotypic traits mostly remains elusive. To address this, we feed 1154 mice of an autoimmunity-prone intercross line (AIL) three different diets. We find that diet substantially contributes to the variability of complex traits and unmasks additional genetic susceptibility quantitative trait loci (QTL). By performing whole-genome sequencing of the AIL founder strains, we resolve these QTLs to few or single candidate genes. To address whether diet can also modulate genetic predisposition towards a given trait, we set NZM2410/J mice on similar dietary regimens as AIL mice. Our data suggest that diet modifies genetic susceptibility to lupus and shifts intestinal bacterial and fungal community composition, which precedes clinical disease manifestation. Collectively, our study underlines the importance of including environmental factors in genetic association studies.