Vetiver ( Vetiveria zizanioides ) is highly attractive to the rice stem borer ( Chilo suppressalis , RSB) and is widely utilized as a trap plant for RSB control in East Asia. However, the underlying mechanism driving this high level of attractiveness remains unclear. In this study, we identified volatiles emitted by vetiver using SPME/GC–MS and found that cedrol constitutes 12.15% of the total volatile profile. Both Y-tube olfactometer and electroantennography assays revealed that cedrol is highly attractive to female RSB moths at a concentration of 200 μg/μL. To investigate the mechanism responsible for the high level of cedrol in vetiver, we sequenced and assembled a chromosome-level genome of vetiver, identifying a vetiver-specific terpene synthase, VzTPS9, which is responsible for the synthesis of cedrol from farnesyl pyrophosphate (FPP). Subsequently, we constructed a transgenic rice line by integrating VzTPS9 into the rice genome. Enzyme assays and gene expression analyses demonstrated that the transgenic rice produced higher levels of cedrol, which were positively correlated with VzTPS9 expression levels, and consequently, with increased attractiveness to female RSB moths. These findings suggest that increased expression of VzTPS9 in vetiver leads to elevated cedrol synthesis, contributing to its enhanced attractiveness to RSB. This work uncovers the molecular mechanism behind vetiver’s high attractiveness to RSB and provides valuable insights for developing more effective strategies for utilizing vetiver as a trap plant in RSB control.