Caenorhabditis elegans is a model organism in biology, yet despite the tremendous information generated from genetic, genomic and functional analyses, C. elegans has rarely been used to address questions in ecological genetics. Here, we analyse genetic variation for chemosensory behaviour, an ecologically important trait that is also genetically well characterized, at both the phenotypic and molecular levels within three species of the genus Caenorhabditis. We show that the G-protein ODR-3 plays an important role in chemosensory avoidance behaviour and identify orthologues of odr-3 in C. briggsae and C. remanei. Both quantitative genetic analysis of chemosensory behaviour and molecular population genetic analysis of odr-3 show that there is little genetic variation among a worldwide collection of isolates of the primarily selfing C. elegans, whereas there is substantially more variation within a single population of the outcrossing C. remanei. Although there are a large number of substitutions at silent sites within odr-3 among the three species, molecular evolution at the protein level is extremely conserved, suggesting that odr-3 plays an important role in cell signalling during chemosensation and/or neuronal cilia development in C. remanei and in C. briggsae as it does in C. elegans. Our results suggest that C. remanei may be a more suitable subject for ecological and evolutionary genetic studies than C. elegans.