Phoresy is a widespread form of commensalism that facilitates dispersal of one species through an association with a more mobile second species. Dauer larvae of the nematode Caenorhabditis elegans exhibit a phoretic behavior called nictation, which could enable interactions with animals such as isopods or snails. Here, we show that natural C. elegans isolates differ in nictation. We use quantitative behavioral assays and linkage mapping to identify a genetic locus (nict-1) that mediates the phoretic interaction with terrestrial isopods. The nict-1 locus contains a Piwi-interacting small RNA (piRNA) cluster; we observe that the Piwi Argonaute PRG-1 is involved in the regulation of nictation. Additionally, this locus underlies a trade-off between offspring production and dispersal. Variation in the nict-1 locus contributes directly to differences in association between nematodes and terrestrial isopods in a laboratory assay. In summary, the piRNA-rich nict-1 locus could define a novel mechanism underlying phoretic interactions.Nematodes use a characteristic set of movements, called nictation, to hitchhike on more mobile animals. Here, Lee et al. identify a genetic locus in the nematode Caenorhabditis elegans that underlies nictation and contributes to successful hitchhiking, but at expense of reduced offspring production.