Variation in susceptibility to infectious disease often has a substantial genetic component in animal and plant populations. We have used genome-wide association studies (GWAS) in Drosophila melanogaster to identify the genetic basis of variation in susceptibility to viral infection. We found that there is substantially more genetic variation in susceptibility to two viruses that naturally infect D. melanogaster (DCV and DMelSV) than to two viruses isolated from other insects (FHV and DAffSV). Furthermore, this increased variation is caused by a small number of common polymorphisms that have a major effect on resistance and can individually explain up to 47% of the heritability in disease susceptibility. For two of these polymorphisms, it has previously been shown that they have been driven to a high frequency by natural selection. An advantage of GWAS in Drosophila is that the results can be confirmed experimentally. We verified that a gene called pastrel--which was previously not known to have an antiviral function--is associated with DCV-resistance by knocking down its expression by RNAi. Our data suggest that selection for resistance to infectious disease can increase genetic variation by increasing the frequency of major-effect alleles, and this has resulted in a simple genetic basis to variation in virus resistance.