The inability to digest lactose, due to lactase nonpersistence, is a common trait in adult mammals, except in certain human populations that exhibit lactase persistence. It is not known how the lactase gene is dramatically downregulated with age in most individuals but remains active in some individuals. We performed a comprehensive epigenetic study of human and mouse small intestines, by using chromosome-wide DNA-modification profiling and targeted bisulfite sequencing. Epigenetically controlled regulatory elements accounted for the differences in lactase mRNA levels among individuals, intestinal cell types and species. We confirmed the importance of these regulatory elements in modulating lactase mRNA levels by using CRISPR-Cas9-induced deletions. Genetic factors contribute to epigenetic changes occurring with age at the regulatory elements, because lactase-persistence and lactase-nonpersistence DNA haplotypes demonstrated markedly different epigenetic aging. Thus, genetic factors enable a gradual accumulation of epigenetic changes with age, thereby influencing phenotypic outcome.