To what extent do host genetics control the composition of the gut microbiome? Studies comparing the gut microbiota in human twins and across inbred mouse lines have yielded inconsistent answers to this question. However, candidate gene approaches, in which one gene is deleted or added to a model host organism, show that a single host gene can have a tremendous effect on the diversity and population structure of the gut microbiota. Now, quantitative genetics is emerging as a highly promising approach that can be used to better understand the overall architecture of host genetic influence on the microbiota, and to discover additional host genes controlling microbial diversity in the gut. In this Review, we describe how host genetics and the environment shape the microbiota, and how these three factors may interact in the context of chronic disease.