Organisms' ability to respond to life-threatening environmental impacts is crucial for their survival. While acute stress responses to unfavorable factors are well known, the physiological consequences of transient stress experiences over time, as well as their underlying mechanisms, are not well understood. In this study, we investigated the long-term effects of a short heat shock (HS) exposure on the transcriptome of C. elegans. We found that the canonical HS response was followed by a profound transcriptional reprogramming affecting many genes involved in innate immunity response. This reprogramming relies on the endoribonuclease ENDU-2 but not the heat shock factor 1 (HSF-1). ENDU-2 in this context co-localizes with chromatin and interacts with RNA polymerase Pol II, enabling specific regulation of transcription in the post-HS period. Failure to activate this post-HS response does not impair animal survival under continuous HS insult but eliminates the beneficial effects of hormetic HS. In summary, our work discovers that the RNA-binding protein ENDU-2 mediates the hormetic long-term effects of transient HS to determine aging and longevity.