Rhizobia form symbiotic relationships with legumes, fixing atmospheric nitrogen into a plant-accessible form within their root nodules. Nitrogen fixation is vital for sustainable soil improvements in agriculture. Peanut (Arachis hypogaea) is a leguminous crop whose nodulation mechanism requires further elucidation. In this study, comprehensive transcriptomic and metabolomic analyses were conducted to assess the differences between a non-nodulating peanut variety and a nodulating peanut variety. Total RNA was extracted from peanut roots, then first-strand and second-strand cDNA were synthesized and purified. After sequencing adaptors were added to the fragments, the cDNA libraries were sequenced. Our transcriptomic analysis identified 3362 differentially expressed genes (DEGs) between the two varieties. Gene ontology and Kyoto Encyclopedia of Genes and Genomes analyses revealed that the DEGs were mainly involved in metabolic pathways, hormone signal transduction, secondary metabolic biosynthesis, phenylpropanoid biosynthesis, or ABC transport. Further analyses indicated that the biosynthesis of flavonoids, such as isoflavones, flavonols, and flavonoids, was important for peanut nodulation. A lack of flavonoid transport into the rhizosphere (soil) could prevent rhizobial chemotaxis and the activation of their nodulation genes. The downregulation ofAUXIN-RESPONSE FACTOR(ARF) genes and lower auxin content could reduce rhizobia’s invasion of peanut roots, ultimately reducing nodule formation. Auxin is the major hormone that influences the cell-cycle initiation and progression required for nodule initiation and accumulates during different stages of nodule development. These findings lay the foundation for subsequent research into the nitrogen-fixation efficiency of peanut nodules.