Epigenetic gene regulation is central to eukaryotic biology. Nevertheless, epigenetic gene regulation shows a surprising diversity, such that many pathways that are essential in mammals have been lost altogether several times independently across metazoans. Intriguingly, these epigenetic pathways also show considerable variation in human cancer, including frequent inactivating mutations. We are using comparative epigenomics across metazoans to understand the factors driving diversity of epigenetic regulation, and hence gain insight into its role in cancer development. Here I will present a recent example of our approach, in which we focussed on the evolution of cytosine DNA methylation. Methylation at the 5 position of cytosine in DNA (5meC), is the archetypal epigenetic mark in eukaryotes. Once introduced by de novo methyltransferases (DNMT3a/b in mammals), 5meC can be maintained through DNA replication due to the ability of a “maintenance” methyltransferase (DNMT1 in mammals). Despite their ancient origin, DNA methylation pathways differ widely across metazoans, such that 5meC is either confined to transcribed genes or lost altogether in several lineages. Using comparative genomics we identified a surprising coevolution signature between DNA methyltransferases and the DNA alkylation repair enzyme ALKB2. We provide an explanation for this by demonstrating that DNA methyltransferases cause alkylation damage by introducing 3meC into DNA, both in vivo and in vitro. Thus we identify a novel toxic byproduct of epigenetic regulation by DNA methylation, which may explain why DNA methylation is so frequently lost throughout evolution.