Lifespan in Caenorhabditis elegans, Drosophila, and mice is regulated by conserved signaling networks, including the insulin/insulin-like growth factor 1 (IGF-1) signaling cascade and pathways depending on sirtuins, a family of NAD(+)-dependent deacetylases. Small molecules such as resveratrol are of great interest because they increase lifespan in many species in a sirtuin-dependent manner. However, no endogenous small molecules that regulate lifespan via sirtuins have been identified, and the mechanisms underlying sirtuin-dependent longevity are not well understood. Here, we show that in C. elegans, two endogenously produced small molecules, the dauer-inducing ascarosides ascr#2 and ascr#3, regulate lifespan and stress resistance through chemosensory pathways and the sirtuin SIR-2.1. Ascarosides extend adult lifespan and stress resistance without reducing fecundity or feeding rate, and these effects are reduced or abolished when nutrients are restricted. We found that ascaroside-mediated longevity is fully abolished by loss of SIR-2.1 and that the effect of ascr#2 requires expression of the G protein-coupled receptor DAF-37 in specific chemosensory neurons. In contrast to many other lifespan-modulating factors, ascaroside-mediated lifespan increases do not require insulin signaling via the FOXO homolog DAF-16 or the insulin/IGF-1-receptor homolog DAF-2. Our study demonstrates that C. elegans produces specific small molecules to control adult lifespan in a sirtuin-dependent manner, supporting the hypothesis that endogenous regulation of metazoan lifespan functions, in part, via sirtuins. These findings strengthen the link between chemosensory inputs and conserved mechanisms of lifespan regulation in metazoans and suggest a model for communal lifespan regulation in C. elegans.