One of the most fundamental challenges for all living organisms is to sense and respond to alternating nutritional conditions in order to adapt their metabolism and physiology to promote survival and achieve balanced growth. Here, we applied metabolomics and lipidomics to examine temporal regulation of metabolism during starvation in wild-type Caenorhabditis elegans and in animals lacking the transcription factor HLH-30. Our findings show for the first time that starvation alters the abundance of hundreds of metabolites and lipid species in a temporal- and HLH-30-dependent manner. We demonstrate that premature death of hlh-30 animals under starvation can be prevented by supplementation of exogenous fatty acids, and that HLH-30 is required for complete oxidation of long-chain fatty acids. We further show that RNAi-mediated knockdown of the gene encoding carnitine palmitoyl transferase I (cpt-1) only impairs survival of wild-type animals and not of hlh-30 animals. Strikingly, we also find that compromised generation of peroxisomes by prx-5 knockdown renders hlh-30 animals hypersensitive to starvation, which cannot be rescued by supplementation of exogenous fatty acids. Collectively, our observations show that mitochondrial functions are compromised in hlh-30 animals and that hlh-30 animals rewire their metabolism to largely depend on functional peroxisomes during starvation, underlining the importance of metabolic plasticity to maintain survival.