Erythema nodosum leprosum (ENL), an inflammatory reaction in leprosy, causes painful nodules, fever, and malaise due to immune system activation. Thalidomide is an effective treatment, although associated with important adverse effects. We aimed to evaluate the association of genetic variants in genes encoding tumor necrosis factor alpha (TNF-α), interleukin-1 beta (IL-1β) and interleukin-6 (IL-6) with the response to treatment of ENL with thalidomide. 148 patients from the South and Northeast regions of Brazil were included. Genomic DNA was isolated from blood and/or saliva samples using commercial kits, and genetic variants in TNF, IL6, IL1β, and IFNγ genes were genotyped by TaqMan system. We identified an association between polymorphisms in TNF (rs1799964C, rs1800630A, rs1799724T and rs1800629A) IL1β (rs4848306G, rs1143623G, rs16944A, and rs1143627A), IL6 (rs2069840C and rs2069845G) and IFNγ (rs2430561T) with thalidomide dose variation in a time-dependent manner. Associations of IL6 and TNF haplotypes with thalidomide dosage variation over the time of treatment were also observed. Polymorphisms in TNF, IL6, IL1β, and IFNγ genes may modulate their expression levels, potentially impacting the required dosage of thalidomide in the treatment of ENL. Our findings should be confirmed in further studies to estimate the size effect of these polymorphisms on ENL treatment with thalidomide.