Odour–genes covariance (i.e. that individual odour similarities covary with genetic similarity) allows animals to assess their genetic relatedness to one another by comparing the similarities between their individual odours. The reliability of the odour–gene covariance phenomenon under environmental changes has not yet been explored. Using an innovative habituation-generalization procedure, we tested whether the modifications of body odours induced by a change in diet interfered with the perceived similarity of individual odours of more genetically similar individuals. The effects of a change in diet, by adding aniseed flavour to the drinking water, was assessed in male mound-building mice, a species in which odour–genes covariance has already been demonstrated. The results obtained indicate that mice perceive more similarities in the odours of sibling males than in those of nonrelatives, despite the effects of diet on body odours. We suggest that the reliability of signals arising from odour–genes covariance is likely a result of the independence between traits indicating genetic relatedness and indicator signals of biological states (e.g. diet) in body odours.