In the Lepidoptera, sex-linked genes have been found to be of importance for species differences in, for example, host-plant preference, and have been implicated in ecological speciation. Variation within species is typically not sex-linked. However, in the comma butterfly Polygonia c-album (Nymphalidae) an X-linked gene has been found to play a major role in determining differences in host-plant use between two well separated populations. For this reason, we studied the role of sex-linked genes for host-plant preference within a single Swedish population of this species. Three generations of females with known pedigrees were studied in the laboratory, and they were given a choice between Urtica dioica and Salix caprea in flight cages. We found strong variation among females and significant genetic variance for host-plant preference, but no evidence for major importance of sex linkage of host-plant preference on this local scale. To what extent the observed genetic variation was due to additive genes and/or effects of major genes was not clear from the maximum likelihood analysis. In a follow-up study we sampled females over a larger area. We found strong variation among females, but not among localities, suggesting an open population structure with strong gene flow. From the combined stock, a selection experiment was performed over 2 years and six generations. The selection lines diverged after the first generation of selection and remained separate, but did not diverge further, suggesting a low degree of narrow-sense heritability and that the genetic differences may be effects of major genes. We discuss these results in relation to the possible role of genetics in the radiation of the Lepidoptera and other phytophagous insects. © 2005 The Linnean Society of London, Biological Journal of the Linnean Society, 2005, 84, 755–765.