This study was undertaken to investigate the protective role of trans-anethole (TA) in lipopolysaccharide (LPS)-induced rat intestinal epithelial cells (IEC-6) injury and the potential mechanisms. The cells were pretreated with TA (0 and 1 mM) for 24 h, prior to stimulation by LPS (1 mg/mL) for 24 h. Compared with the control group (CON), LPS stimulus resulted in decreased cell viability, intestinal barrier injury, increased cell apoptosis and cell cycle arrest at the G2/M phase. These effects triggered by LPS were reversed by TA. In order to reveal the main genes and pathways involved among the groups, transcriptome analysis was performed to identify the differential expression genes (DEGs) among the treatment groups. There were a total of 493 DEGs (275 upregulated and 218 downregulated) that were identified between the LPS and CON group. Meanwhile, a total of 361 DEGs (103 regulated and 258 downregulated) were identified in the LPS+TA group compared with the LPS group. The results showed that the DEGs were mostly enriched in immune related pathways, such as tumor necrosis factor (TNF) signaling pathway, cytokine-cytokine receptor interaction, complement and coagulation cascades, interleukin-17 (IL-17) signaling pathway, NF-kappa B (NF-κB) signaling pathway, antigen processing and presentation, and NOD-like receptor signaling pathway. Based on the results of RNA-sequencing, further investigation of the signaling pathway involved revealed that TA could inhibit the activation of toll like receptor 4 (TLR4)/NF-κB signaling pathway and NLR family pyrin domain containing 3 (NLRP3) inflammasome in LPS-induced IEC-6 cells. In conclusion, this finding demonstrated a functional role of TA in intestinal epithelial cells injury and indicated that TA may be a potential strategy for treatment of inflammatory intestinal diseases.