The model nematode Pristionchus pacificus produces four types of complex ascaroside pheromones named UBAS, DASC, NPAR, and PASC. However, the exact biosynthetic pathways of these modular signaling molecules remain enigmatic. We have previously identified a carboxylesterase Ppa-UAR-1 for the biosynthesis of UBAS, enabling the attachment of ureidoisobutyric acid at the 4\'-position of simple ascarosides. Here, we report three new carboxylesterases Ppa-UAR-5, Ppa-UAR-6 and Ppa-UAR-12 from P. pacificus. Ppa-UAR-5 functions downstream of Ppa-UAR-1 to furnish the biosynthesis of ubas#1 and ubas#2, whereas Ppa-UAR-12 specifically links two ascr#1 at the 4\'-position to synthesize dasc#1. Finally, Ppa-UAR-6 is essential for the biosynthesis of npar#1-3 and part#9. The expression patterns of Ppa-uar-6 and Ppa-uar-12 in the intestinal and epidermal cells suggest pheromone biosynthesis to be restricted to specific tissues. These findings indicate that the expansion and functional diversification of carboxylesterases plays a crucial role in the evolution of complex pheromones in nematodes.