During lung resection surgery, the blood supply to the lungs increases the intrapulmonary shunt and reduces arterial oxygenation in patients. Ventilation anesthesia of a lung may affect oxygenation. The present study aimed to compare intravenous anesthesia with and without thoracic epidural block (dezocine and ropivacaine) on oxygen saturation during lung ventilation in patients undergoing lung resection surgery. For this purpose, this study was performed as a double-blind, randomized clinical trial. Sixty patients who were candidates for lung resection were divided into two intervention groups (thoracic epidural block with dezocine and ropivacaine and intravenous anesthesia) and a control group (placebo thoracic epidural block and intravenous anesthesia). Hemodynamic variables, Aldert score, and possible complications were compared between the two groups before surgery and after recovery. Also, the expression level of the IDO gene was evaluated using the real-time PCR technique. SPSS, t-test, Mann-Whitney U, Chi-square, and Fisher performed data analysis and comparison. The results showed that the changes in hemodynamic variables and PaO2, SaO2, and ETCO2 were not statistically significant between the two groups. Aldrete's score at entry and exit of recovery was similar between the two groups. During the recovery period, the percentage of pain or chills in the group under complete intravenous anesthesia was significantly higher. There was no significant difference between the two groups regarding the frequency of nausea and hypotension. Also, the results of IDO gene expression showed that general anesthesia with the thoracic epidural block (dezocine and ropivacaine), which is involved in inducing immunological tolerance and suppressing immune responses, has no significant effect. The stress of performing surgery before surgery can play a role in suppressing the patient's immunity, and anesthesia of the thoracic epidural block (dezocine and ropivacaine) has no significant effect on IDO expression. In general, thoracic epidural block with complete intravenous anesthesia has no significant effect on oxygen saturation in ventilated lungs compared with intravenous anesthesia alone. Nevertheless, this combination significantly reduces postoperative pain and chills.