Drosomycin-type antifungal peptides (DTAFPs) are natural effectors of the innate immune system, which are restrictedly distributed in plants and ecdysozoans. Mehamycin is a bi-domain DTAFP (abbreviated as bDTAFP) firstly found in the Northern root-knot nematode Meloidogyne hapla. Here, we report its structural and functional features and the evolution of bDTAFPs in nematodes. Different from classical DTAFPs, mehamycin contains an insertion, called single Disulfide Bridge-linked Domain (abbreviated as sDBD), located in a loop region of the drosomycin scaffold. Despite this, recombinant mehamycin likely adopts a similar fold to drosomycin, as revealed by the circular dichroism spectral analysis. Functionally, it showed some weak activity against three species of fungi but relatively stronger activity against seven species of Gram-positive bacteria, indicative of functional diversification between mehamycin and classical DTAFPs. By computational data mining of the nematode databases, we identified polymorphic genes encoding mehamycin and a new multigene family of bDTAFPs (named roremycins) from Rotylenchulus reniformis. A combination of data suggests that the origination of sDBDs from M. hapla and R. reniformis is a consequence of convergent evolution, in which some probably suffered positive selection during evolution. Our study may be valuable in understanding the role of these unique antimicrobial peptides in the innate immunity of nematodes.