Genetic pest control strategies based on precise sex separation and only releasing sterile males can be accomplished by site-specific genome editing. In the current study, we showed that the mutation of single-allele Pxfl(2)d can significantly impair the normal mating behavior and testis development in male adults of the notorious cruciferous insect pest Plutella xylostella, in addition to its known functions in the ovarian development in female adults and egg hatching. Subsequent CRISPR/Cas9-based knock-in experiments revealed that site-specific integration of an exogenous green fluorescent protein (GFP) gene into autosomal Pxfl(2)d for labelling mutants could be achieved. However, this gene is not a suitable target for GFP insertion to establish a genetically stable knock-in strain because of the severe decline in reproductive capacity. We further screened for the W-chromosome-linked and Z-chromosome-linked regions to test the knock-in efficiency mediated by CRISPR/Cas9. The results verified that both types of chromosomes can be targeted for the site-specific insertion of exogenous sequences. We ultimately obtained a homozygous knock-in strain with the integration of both Cas9 and cyan fluorescent protein (CFP) expression cassettes on a Z-linked region in P. xylostella, which can also be used for early sex detection. By injecting the sgRNA targeting Pxfl(2)d alone into the eggs laid by female adults of the Z-Cas9-CFP strain, the gene editing efficiency reached 29.73%, confirming the success of expressing a functional Cas9 gene. Taken together, we demonstrated the feasibility of the knock-in of an exogenous gene to different genomic regions in P. xylostella, while the establishment of a heritable strain required the positioning of appropriate sites. This study provides an important working basis and technical support for further developing genetic strategies for insect pest control.