In quantitative real-time PCR (qRT-PCR) detection, the stability of reference genes varies with different organs, tissue locations, sex and developmental stages. This study aimed to screen out and determine the optimal panel of reference genes of the intestine in pre- and post-natal rats of different sex. We used qRT-PCR to detect the mRNA expression of six commonly used reference genes (ACTB, GAPDH, HPRT1, B2M, RPLPO and SDHA) in rat intestines at gestational day 21 (GD21) and postnatal week 12 (PW12). Using GeNorm, BestKeeper and NormFinder software comprehensively analyzed the stability of candidate reference genes and screened out stable reference genes. Further, we used the pathological model of prenatal dexamethasone exposure (PDE) to verify the stability of the selected panel of reference genes. Based on the results of the software analysis, the optimal panel of reference genes in the fetal rat intestine was SDHA + ACTB, and the adult rat small intestine and colon were ACTB + HPRT1 and RPLP0 + GAPDH, respectively. There was no significant sex difference in the above results. Besides, in the PDE model, the results were consistent with those under physiological conditions. Therefore, the stability of intestinal reference genes in fetal rats and adult rats was different, and the intestinal reference genes of adult rats were intestinal segments-specific. The selected panel of reference genes was still stable under pathological conditions. This study determined the optimal panel of reference genes of pre- and post-natal rat intestines and provided reliable reference genes for the qRT-PCR analysis of rat intestines.