Enzymatic addition of methyl (CH3) group to DNA which causes inactivation of that region. Usually CpG nucleotide pairs are target for this addition.