Background: Evidence on the health benefits of green space in residential environments is still limited, and few studies have investigated the potential association between blue space and type 2 diabetes mellitus (T2DM) prevalence. Methods: The study included 39,019 participants who had completed the baseline survey from Henan Rural Cohort, 2015–2017. The Normalized Vegetation Index (NDVI) and Enhanced Vegetation Index (EVI) were employed to characterize the residential green space, and the distance from the participant's residential address to the nearest water body was considered to represent the residential blue space. Mixed effect models were applied to evaluate the associations of the residential environment with T2DM and fasting blood glucose levels. Results: An interquartile range (IQR) increase in NDVI and EVI was significantly associated with a 13.4% (Odds ratio (OR):0.866, 95%Confidence interval (CI): 0.830, 0.903) and 14.2% (OR:0.858, 95%CI: 0.817,0.901) decreased risk of T2DM, respectively. The residential green space was associated with lower fasting blood glucose levels in men (%change, –2.060 in men vs. –0.972 in women) and the elderly (%change, –1.696 in elderly vs. –1.268 in young people). Additionally, people who lived more than 5 km from the water body had a 15.7% lower risk of T2DM (OR: 0.843, 95% CI: 0.770, 0.923) and 1.829% lower fasting blood glucose levels (95% CI: –2.335%,–1.320%) than those who lived closer to the blue space. Conclusion: Our findings suggest that residential green space was beneficially associated with T2DM and fasting blood glucose levels. However, further research is needed to explore more comprehensively the relationship between residential blue space and public health.