Vitamin D (VD) deficiency and osteoporosis have become a global public health problem. A variant in the Histidine Ammonia-Lyase (HAL) gene has been associated with VD levels and bone mineral density (BMD). However, whether this variant has an influence on VD levels and BMD in Mexican adults remain unclear. This cross-sectional analysis included 1,905 adults participating in the Health Worker Cohort Study and 164 indigenous postmenopausal women from the Metabolic Analysis in an Indigenous Sample (MAIS) cohort. The rs3819817 variant was genotyped by TaqMan probe assay. Total 25 hydroxyvitamin D levels were measured by DiaSorin Liaison. BMD at the different sites was assessed through dual-energy X-ray absorptiometry. Linear and logistic regression models were performed to evaluate the associations of interest. The prevalence of VD deficiency was 41%, showing differences between sexes. Obesity and skin pigmentation were associated with lower levels of VD in males and females. rs3819817-T allele was associated with low levels of 25-hydroxyvitamin D, VD deficiency, and hip and femoral neck BMD values (g/cm2). We found two interactions with VD levels, one between adiposity and rs3819817-T allele (P = 0.017) and another between skin pigmentation and rs3819817-T allele (P = 0.019). In indigenous postmenopausal women, we observed higher VD levels in the southern region compared to the northern region (P < 0.001); however, we did not observe differences by genotype. Our findings confirm that the genetic variant rs3819817 has an essential function in VD levels and BMD and suggests a role in skin pigmentation in the Mexican population.