Food and host-preference relies on genetic adaptation and sensory experience. In vertebrates, experience with food-related cues during early development can change adult preference. This is also true in holometabolous insects, which undergo a drastic nervous system remodelling during their complete metamorphosis, but remains uncertain in Drosophila melanogaster. We have conditioned D. melanogaster with oleic (C18∶1) and stearic (C18∶0) acids, two common dietary fatty acids, respectively preferred by larvae and adult. Wild-type individuals exposed either during a transient period of development–from embryo to adult–or more permanently–during one to ten generation cycles–were affected by such conditioning. In particular, the oviposition preference of females exposed to each fatty acid during larval development was affected without cross-effect indicating the specificity of each substance. Permanent exposure to each fatty acid also drastically changed oviposition preference as well as major fitness traits (development duration, sex-ratio, fecundity, adult lethality). This suggests that D. melanogaster ability to adapt to new food sources is determined by its genetic and sensory plasticity both of which may explain the success of this generalist-diet species.