The mammalian gut microbiota is considered to be determined mostly by diet, while the effect of genotype is still controversial. Here, we examined the effect of genotype on the gut microbiota in normal populations, exhibiting only natural polymorphisms, and evaluated this effect in comparison to the effect of sex. DNA fingerprinting approaches were used to profile the gut microbiota of eight different recombinant inbred mouse lines of the collaborative cross consortium, whose level of genetic diversity mimics that of a natural human population. Analyses based on automated ribosomal internal transcribed spacer analysis demonstrated significant higher similarity of the gut microbiota composition within mouse lines than between them or within same-gender groups. Thus, genetic background significantly impacts the microbiota composition and is a stronger determinant than gender. These findings imply that genetic polymorphisms help shape the intestinal microbiota of mammals and consequently could affect host susceptibility to diseases.