Collectively, our study suggests that the methylation modification in Nckap5 and transposon MTD might be considered as epigenetic markers in resistance to S. aureus-infected mastitis and provided a new insight into S. aureus mastitis research in dairy industry and public health. The gene discussed is NCKAP5; the disease is mastitis.