Milk production is an essential economic trait in cattle, and understanding the genetic regulation of this trait can enhance breeding strategies. The discoidin domain receptor 1 (DDR1) gene has been identified as a key candidate gene that influences milk production, and ETS homologous factor (EHF) is recognized as a critical transcription factor that regulates DDR1 expression. Codon usage bias, which affects gene expression and protein function, has not been fully explored in cattle. This study aims to examine the codon usage bias of DDR1 and EHF transcription factors to understand their roles in dairy production traits. Data from 24 species revealed that both DDR1 and EHF predominantly used G/C-ending codons, with the GC3 content averaging 75.49% for DDR1 and 61.72% for EHF. Synonymous codon usage analysis identified high-frequency codons for both DDR1 and EHF, with 17 codons common to both genes. Correlation analysis indicated a negative relationship between the effective number of codons and codon adaptation index for both DDR1 and EHF. Phylogenetic and clustering analyses revealed similar codon usage patterns among closely related species. These findings suggest that EHF plays a crucial role in regulating DDR1 expression, offering new insights into genetically regulating milk production in cattle.