Mental distress is a common health problem facing university students worldwide. It manifests with varying levels of depression, anxiety, and somatic symptoms such as headache, backache, sleeping problems, and fatigue. University students are a high-risk group for mental distress than the general population. This study aimed to assess knowledge, the prevalence of mental distress, and its associated factors among undergraduate students. A cross-sectional study was conducted among undergraduate students at the University of Dodoma in Tanzania. Data were collected using pre-tested and self-administered questionnaires. Bivariate and multivariable logistic regression models were used to identify factors associated with mental distress. A total of 224 undergraduate students gave a complete response, of which the majority were aware of the common symptoms of mental distress. Self-reported mental distress experience was reported among 116/224 (51.8%) students. Multivariable logistic analysis showed that only alcohol consumption (aPR = 1.61, 95% CI 1.22–2.11, p = 0.001) was independently associated with mental distress among students. The findings of this study revealed that undergraduate students had adequate knowledge of the symptoms of mental distress. Our results show that the prevalence of self-reported mental distress was moderately high among undergraduate students. Furthermore, the study indicates a significant association between alcohol consumption and self-reported mental distress among these students. These results suggest that interventions aimed at reducing alcohol consumption may be beneficial in mitigating mental health issues among undergraduate students in Tanzania.