Hosts exhibit a variety of defence mechanisms against parasites, including avoidance. Both host–parasite coevolutionary dynamics and the host mating system can alter the evolutionary trajectories of populations. Does the nature of host–parasite interactions and the host mating system affect the mechanisms that evolve to confer host defence? In a previous experimental evolution study, mixed mating and obligately outcrossing Caenorhabditis elegans host populations adapted to either coevolving or static Serratia marcescens parasite populations. Here, we assessed parasite avoidance as a mechanism underlying host adaptation. We measured host feeding preference for the coevolved and static parasites vs preference for Escherichia coli, to assess the evolution of avoidance behaviour within our experiment. We found that mixed mating host populations evolved a preference for E. coli relative to the static parasite strain; therefore, the hosts evolved parasite avoidance as a defence. However, mixed mating hosts did not exhibit E. coli preference when exposed to coevolved parasites, so avoidance cannot account for host adaptation to coevolving parasites. Further, the obligately outcrossing host populations did not exhibit parasite avoidance in the presence of either static or coevolved parasites. Therefore, both the nature of host–parasite interactions and the host mating system shaped the evolution of host defence.