The possibility that odor plays a role in lifespan regulation through effects on the nervous system is indicated by research on Caenorhabditis elegans. In fact, ablation of AWA and AWC, which are suggested as olfactory neurons, has been shown to extend lifespan via DAF-16, a homolog of FoxO. However, the effects of odor stimuli on the lifespan still remain unclear. Thus, we here aimed to clarify the effect of attractive and repulsive odors on longevity and stress tolerance in C. elegans and to analyze the pathways thereof. We used isoamyl alcohol as an attractive odor, and acetic acid as a repellent component, as identified by chemotaxis assay. We found that isoamyl alcohol stimulus promoted longevity in a DAF-16-dependent manner. On the other hand, acetic acid stimulus promoted thermotolerance through mechanisms independent of DAF-16. Above all, our results indicate that odor stimuli affect the lifespan and stress tolerance of C. elegans, with attractive and repulsive odors exerting their effects through different mechanisms, and that longevity is induced by both activation and inactivation of olfactory neurons.