<jats:p> To sense its population density and to trigger entry into the stress-resistant dauer larval stage, <jats:italic>Caenorhabditis elegans</jats:italic> uses the dauer pheromone, which consists of ascaroside derivatives with short, fatty acid-like side chains. Although the dauer pheromone has been studied for 25 years, its biosynthesis is completely uncharacterized. The <jats:italic>daf-22</jats:italic> mutant is the only known mutant defective in dauer pheromone production. Here, we show that <jats:italic>daf-22</jats:italic> encodes a homolog of human sterol carrier protein SCPx, which catalyzes the final step in peroxisomal fatty acid β-oxidation. We also show that <jats:italic>dhs-28</jats:italic> , which encodes a homolog of the human <jats:sc>d</jats:sc> -bifunctional protein that acts just upstream of SCPx, is also required for pheromone production. Long-term <jats:italic>daf-22</jats:italic> and <jats:italic>dhs-28</jats:italic> cultures develop dauer-inducing activity by accumulating less active, long-chain fatty acid ascaroside derivatives. Thus, <jats:italic>daf-22</jats:italic> and <jats:italic>dhs-28</jats:italic> are required for the biosynthesis of the short-chain fatty acid-derived side chains of the dauer pheromone and link dauer pheromone production to metabolic state.