Foraging behavior is critical for the fitness of individuals. However, the genetic basis of variation in foraging behavior and the evolutionary forces underlying such natural variation have rarely been investigated. We developed a systematic approach to assay the variation in survival rate in a foraging environment for adult flies derived from a wild Drosophila melanogaster population. Despite being such an essential trait, there is substantial variation of foraging behavior among D. melanogaster strains. Importantly, we provided the first evaluation of the potential caveats of using inbred Drosophila strains to perform genome-wide association studies on life-history traits, and concluded that inbreeding depression is unlikely a major contributor for the observed large variation in adult foraging behavior. We found that adult foraging behavior has a strong genetic component and, unlike larval foraging behavior, depends on multiple loci. Identified candidate genes are enriched in those with high expression in adult heads and, demonstrated by expression knock down assay, are involved in maintaining normal functions of the nervous system. Our study not only identified candidate genes for foraging behavior that is relevant to individual fitness, but also shed light on the initial stage underlying the evolution of the behavior.