Abstract Current evidence suggests that non-traditional serum lipid ratios are more effective than traditional serum lipid parameters in predicting vascular diseases, and both of them are associated with dietary patterns. Therefore, this study aimed to investigate the relationship between the dietary inflammatory index (DII) and atherogenic indices using traditional serum lipid parameters (triglyceride (TG), total cholesterol (TC), LDL cholesterol (LDL–c), high-density lipoprotein cholesterol (HDL–c)) and non-traditional serum lipid ratios (atherogenic index of plasma (AIP), Castelli's index-I (CRI_I), Castelli's index-II (CRI_II), the lipoprotein combination index (LCI), and the atherogenic coefficient (AC)). Basic information from the Ravansar Non-Communicable Diseases cohort study was utilized in the present cross-sectional observational study. The study included 8870 adults aged 35–65 years. A validated food frequency questionnaire (FFQ) was used to measure DII. We compared the distributions of outcomes by DII score groups using multivariable linear regression. The difference between DII score groups was evaluated by the Bonferroni test. The mean ± SD DII was − 2.5 ± 1.43, and the prevalence of dyslipidemia was 44%. After adjusting for age, sex, smoking status, alcohol consumption status, physical activity, systolic blood pressure (SBP), diastolic blood pressure (DBP), fasting blood sugar (FBS), body mass index (BMI) and socioeconomic status (SES), participants in the highest quartile of DII had a greater risk for CRI_I (β = 0.11, CI 0.05, 0.18), CRI_II (β = 0.06, CI 0.01, 0.11), LCI (β = 0.11, CI 288.12, 8373.11), AC (β = 0.11, CI 0.05, 0.17) and AIP (β = 0.06, CI 0.02, 0.10). Moreover, according to the adjusted logistic regression model, the risk of dyslipidemia significantly increased by 24% (OR: 1.24, 95% CI 1.08–1.41), 7% (OR: 1.07, 95% CI 0.94, 1.21) and 3% (OR: 1.03, 95% CI 0.91, 1.16) in Q4, Q3 and Q2 of the DII, respectively. Finally, diet-related inflammation, as estimated by the DII, is associated with a higher risk of CRI-I, CRI-II, LCI, AC, and AIP and increased odds of dyslipidemia.