Bovine fertility remains a critical issue underpinning the sustainability of the agricultural sector. Phenotypic records collected on >7,000 bulls used in artificial insemination (AI) were used to identify 160 reliable and divergently fertile bulls for a dual strategy of targeted sequencing (TS) of fertility-related β-defensin genes and whole exome sequencing (WES). A haplotype spanning multiple β-defensin genes and containing 94 SNPs was significantly associated with fertility and functional analysis confirmed that sperm from bulls possessing the haplotype showed significantly enhanced binding to oviductal epithelium. WES of all exons in the genome in 24 bulls of high and low fertility identified 484 additional SNPs significantly associated with fertility. After validation, the most significantly associated SNP was located in the FOXJ3 gene, a transcription factor which regulates sperm function in mice. This study represents the first comprehensive characterisation of genetic variation in bovine β-defensin genes and functional analysis supports a role for β-defensins in regulating bull sperm function. This first application of WES in AI bulls with divergent fertility phenotypes has identified a novel role for the transcription factor FOXJ3 in the regulation of bull fertility. Validated genetic variants associated with bull fertility could prove useful for improving reproductive outcomes in cattle.