The worm Caenorhabditis elegans, with its short lifecycle and well-known genetic and metabolic pathways, stands as an exemplary model organism for biological research. Its simplicity and genetic tractability make it an ideal system for investigating the effects of different conditions on its metabolism. The chemical analysis of this nematode was performed to identify specific metabolites produced by the worms when fed with either self- or nonself-DNA. A standard diet with OP50 feeding was used as a control. Different development stages were sampled, and their chemical composition was assessed by liquid chromatography–mass spectrometry combined with chemometrics, including both principal component analysis and orthogonal partial least squares discriminant analysis tools. The obtained data demonstrated that self-DNA-treated larvae, when arrested in their cycle, showed significant decreases in dynorphin, an appetite regulator of the nematode, and in N-formyl glycine, a known longevity promoter in C. elegans. Moreover, a substantial decrease was also recorded in the self-DNA-fed adults for the FMRF amide neuropeptide, an embryogenesis regulator, and for a dopamine derivative modulating nematode locomotion. In conclusion, this study allowed for the identification of key metabolites affected by the self-DNA diet, providing interesting hints on the main molecular pathways involved in its biological inhibitory effects.