Pre-harvest aflatoxin contamination caused by Aspergillus favus is a major concern in peanut. However, little is known about the resistance mechanism, so the incorporation of resistance into cultivars with commercially-acceptable genetic background has been slowed. To identify resistance-associated genes potentially underlying the resistance mechanism, we compared transcriptome profiles in resistant and susceptible peanut genotypes under three different treatments: well watered, drought stress and both A. flavus and drought stress using a customised NimbleGen microarray representing 36158 unigenes. Results showed that the profile of differentially expressed genes (DEGs) displayed a similar pattern of distribution among the functional classes between resistant and susceptible peanuts in response to drought stress. Under A. flavus infection with drought stress, a total of 490 unigenes involved in 26 pathways were differentially expressed in the resistant genotype YJ1 uniquely responding to A. flavus infection, in which 96 DEGs were related to eight pathways: oxidation reduction, proteolysis metabolism, coenzyme A biosynthesis, defence response, signalling, oligopeptide transport, transmembrane transport and carbohydrate biosynthesis/metabolism. Pathway analysis based on the Kyoto Encyclopedia of Genes and Genomes (KEGG) database showed that eight networks were significantly associated with resistance to A. flavus infection in resistant genotype YJ1 compared with susceptible Yueyou7. To validate microarray analysis, 15 genes were randomly selected for real-time RT-PCR analysis. The results provided in this study may enhance our understanding of the pre-harvest peanut-A. flavus interaction and facilitate to develop aflatoxin resistant peanut lines in future breeding programs.