Animals adapt their behaviors to specific ecological niches, but the genetic and cellular basis of nervous system evolution is poorly understood. We have compared the olfactory circuits of the specialist Drosophila sechellia-which feeds exclusively on Morinda citrifolia fruit-with its generalist cousins D. melanogaster and D. simulans. We show that D. sechellia exhibits derived odor-evoked attraction and physiological sensitivity to the abundant Morinda volatile hexanoic acid and characterize how the responsible sensory receptor (the variant ionotropic glutamate receptor IR75b) and attraction-mediating circuit have evolved. A single amino acid change in IR75b is sufficient to recode it as a hexanoic acid detector. Expanded representation of this sensory pathway in the brain relies on additional changes in the IR75b promoter and trans-acting loci. By contrast, higher-order circuit adaptations are not apparent, suggesting conserved central processing. Our work links olfactory ecology to structural and regulatory genetic changes influencing nervous system anatomy and function.