The sensory systems of multicellular organisms are designed to provide information about the environment and thus elicit appropriate changes in physiology and behavior. In the nematode Caenorhabditis elegans, sensory neurons affect the decision to arrest during development in a diapause state, the dauer larva, and modulate the lifespan of the animals in adulthood. However, the mechanisms underlying these effects are incompletely understood. Using whole-genome microarray analysis, we identified transcripts whose levels are altered by mutations in the intraflagellar transport protein daf-10, which result in impaired development and function of many sensory neurons in C. elegans. In agreement with existing genetic data, the expression of genes regulated by the transcription factor DAF-16/FOXO was affected by daf-10 mutations. In addition, we found altered expression of transcriptional targets of the DAF-12/nuclear hormone receptor in the daf-10 mutants and showed that this pathway influences specifically the dauer formation phenotype of these animals. Unexpectedly, pathogen-responsive genes were repressed in daf-10 mutant animals, and these sensory mutants exhibited altered susceptibility to and behavioral avoidance of bacterial pathogens. Moreover, we found that a solute transporter gene mct-1/2, which was induced by daf-10 mutations, was necessary and sufficient for longevity. Thus, sensory input seems to influence an extensive transcriptional network that modulates basic biological processes in C. elegans. This situation is reminiscent of the complex regulation of physiology by the mammalian hypothalamus, which also receives innervations from sensory systems, most notably the visual and olfactory systems.