Natural populations exhibit a great deal of interindividual genetic variation in the response to toxins, exemplified by the variable clinical efficacy of pharmaceutical drugs in humans, and the evolution of pesticide resistant insects. Such variation can result from several phenomena, including variable metabolic detoxification of the xenobiotic, and differential sensitivity of the molecular target of the toxin. Our goal is to genetically dissect variation in the response to xenobiotics, and characterize naturally-segregating polymorphisms that modulate toxicity. Here, we use the Drosophila Synthetic Population Resource (DSPR), a multiparent advanced intercross panel of recombinant inbred lines, to identify QTL (Quantitative Trait Loci) underlying xenobiotic resistance, and employ caffeine as a model toxic compound. Phenotyping over 1,700 genotypes led to the identification of ten QTL, each explaining 4.5-14.4% of the broad-sense heritability for caffeine resistance. Four QTL harbor members of the cytochrome P450 family of detoxification enzymes, which represent strong a priori candidate genes. The case is especially strong for Cyp12d1, with multiple lines of evidence indicating the gene causally impacts caffeine resistance. Cyp12d1 is implicated by QTL mapped in both panels of DSPR RILs, is significantly upregulated in the presence of caffeine, and RNAi knockdown robustly decreases caffeine tolerance. Furthermore, copy number variation at Cyp12d1 is strongly associated with phenotype in the DSPR, with a trend in the same direction observed in the DGRP (Drosophila Genetic Reference Panel). No additional plausible causative polymorphisms were observed in a full genomewide association study in the DGRP, or in analyses restricted to QTL regions mapped in the DSPR. Just as in human populations, replicating modest-effect, naturally-segregating causative variants in an association study framework in flies will likely require very large sample sizes.