Abstract Background DNA methyltransferase (DMT) genes contribute to plant stress responses and development by de novo establishment and subsequent maintenance of DNA methylation during replication. The photoperiod and/or temperature-sensitive genic male sterile (P/TGMS) lines play an important role in hybrid seed production of wheat. However, only a few studies have reported on the effect of DMT genes on temperature-sensitive male sterility of wheat. Although DMT genes have been investigated in some plant species, the identification and analysis of DMT genes in wheat (Triticum aestivum L.) based on genome-wide levels have not been reported. Results In this study, a detailed overview of phylogeny of 52 wheat DMT (TaDMT) genes was presented. Homoeolog retention for TaDMT genes was significantly above the average retention rate for whole-wheat genes, indicating the functional importance of many DMT homoeologs. We found that the strikingly high number of TaDMT genes resulted mainly from the significant expansion of the TaDRM subfamily. Intriguingly, all 5 paralogs belonged to the wheat DRM subfamily, and we speculated that tandem duplications might play a crucial role in the TaDRM subfamily expansion. Through the transcriptional analysis of TaDMT genes in a TGMS line BS366 and its hybrids with the other six fertile lines under sterile and fertile conditions, we concluded that TaCMT-D2, TaMET1-B1, and TaDRM-U6 might be involved in male sterility in BS366. Furthermore, a correlation analysis showed that TaMET1-B1 might negatively regulate the expression of TaRAFTIN1A, an important gene for pollen development, so we speculated regarding an epigenetic regulatory mechanism underlying the male sterility of BS366 via the interaction between TaMET1-B1 and TaRAFTIN1A. Conclusions Our findings presented a detailed phylogenic overview of the DMT genes and could provide novel insights into the effects of DMT genes on TGMS wheat.