Non-typeable Haemophilus influenzae contains an N(6)-adenine DNA-methyltransferase (ModA) that is subject to phase-variable expression (random ON/OFF switching). Five modA alleles, modA2, modA4, modA5, modA9 and modA10, account for over two-thirds of clinical otitis media isolates surveyed. Here, we use single molecule, real-time (SMRT) methylome analysis to identify the DNA-recognition motifs for all five of these modA alleles. Phase variation of these alleles regulates multiple proteins including vaccine candidates, and key virulence phenotypes such as antibiotic resistance (modA2, modA5, modA10), biofilm formation (modA2) and immunoevasion (modA4). Analyses of a modA2 strain in the chinchilla model of otitis media show a clear selection for ON switching of modA2 in the middle ear. Our results indicate that a biphasic epigenetic switch can control bacterial virulence, immunoevasion and niche adaptation in an animal model system.