Dyspepsia is a common phenomenon and the majority of patients have functional dyspepsia; however, potential risk factors are unclear, with conflicting results in the literature. Although several risk factors have been evaluated previously, this knowledge has not led to more effective management of the disease. The aim of this study was to assess potential novel risk factors for dyspepsia in both a cross-sectional and a nested case-control study among a randomly selected community-based cohort. A valid questionnaire was mailed to a random sample of Olmsted County, MN residents (n = 659 responders; 133 had dyspepsia). In a nested case-control study, dyspeptic patients (n = 52) and healthy controls (n = 40) identified among community respondents completed further questionnaires on diet. Independent risk factors for dyspepsia adjusted for age, sex, body mass index and anti-secretory therapy were a positive family history of abdominal pain [odds ratio (OR) = 4.7, 95% confidence interval (CI) = 1.5-14.9, P = 0.008] and indigestion (OR = 3.4, 95% CI = 1.0-11.5, P = 0.048), difficulty falling asleep (OR = 8.2, 95% CI = 2.2-31.5, P = 0.002), poor sleep associated with worsening symptoms (OR = 15.9, 95% CI = 2.0-124.9, P = 0.009) and a high somatic symptom checklist score (OR = 5.6, 95% CI = 1.5-20.7, P = 0.01). Diet, including total calories (kcal day(-1)) and total protein, carbohydrate and fat intake (g day(-1)), was not significantly associated with dyspepsia. Familial aggregation raises the possibility of a genetic component, although environmental factors also need to be considered. Sleep dysfunction and somatization suggest a primary psychological component.