WHO predicts that major depressive disorder (MDD) will become the largest disease burden in the world by 2030. Studies have shown that about two-thirds of patients with MDD have painful somatic symptoms. The pathogenesis of MDD combined with pain is yet fully understood. The brain mechanism is the hotspot of current research. The brain activation areas were observed in patients with MDD (with pain or not) in our study, using the technology of contact heat stimulation combined with fMRI (CHS-fMRI). The purpose of this study is to explore the brain network related to pain in MDD, and further to provide useful information for the early diagnosis and treatment of MDD associated with pain. We recruited 42 untreated patients (meeting with the DSM-5 diagnostic criteria for MDD), who were assigned into two groups: pain group (MDDP group, 22 cases) and no pain group (MDDNP group, 20 cases), and 22 healthy volunteers were recruited as control group(HC group). Before the experiment, all subjects have completed the test of visual analogue scale (VAS) and the Mc-Gill pain questionnaire-2 (SF-MPQ-2). During the acquisition of fMRI, the right dorsal forearm received CHS in 51 degree. Finally, VAS was used to score the heat pain stimulation for each subject, as well as the quantitative sensory test (QST) of the contact heat stimulus site was performed. These activated brain areas in MDD group with statistical significance (P < 0.05) included bilateral cerebellum,vermis,right frontal cortex, right middle temporal gyrus, right thalamus, middle cingulate gyrus, and bilateral semioval center. These decreased activated brain areas in MDD group with statistical significance (P < 0.05) included bilateral hippocampus, bilateral amygdale, bilateral putamen, bilateral thalamus, bilateral insula, bilateral inferior frontal gyrus, right superior frontal gyrus, bilateral temporal lobe, and right calcarine. These activated brain areas in HC group with statistical significance (P < 0.05) included bilateral cerebellum, vermis, bilateral inferior frontal gyrus, right middle frontal gyrus, bilateral temporal lobe, bilateral inferior parietal lobule, left lingual gyrus, and left cuneus gyrus. These decreased activated brain areas in HC group with statistical significance (P < 0.05) included bilateral hippocampus, bilateral parahippocampal gyrus, bilateral middle temporal gyrus, bilateral amygdala, bilateral thalamus, bilateral putamen, bilateral insula, bilateral lingual gyrus, and right calcarine. The application of technology of CHS-fMRI is an ideal method for studying the network related to pain. There are abnormal activation of frontal-limbic region in MDDP group compared with MDDNP and HC group. Moreover, their activated area and activated intensity of activated brain regions are different. The network related to pain may change in MDD, which is worthy of further study.