Nitric oxide (NO) is an important signaling molecule in multicellular organisms. Most animals produce NO from L-arginine via a family of dedicated enzymes known as NO synthases (NOSes). A rare exception is the roundworm Caenorhabditis elegans, which lacks its own NOS. However, in its natural environment, C. elegans feeds on Bacilli that possess functional NOS. Here, we demonstrate that bacterially derived NO enhances C. elegans longevity and stress resistance via a defined group of genes that function under the dual control of HSF-1 and DAF-16 transcription factors. Our work provides an example of interspecies signaling by a small molecule and illustrates the lifelong value of commensal bacteria to their host.