: Cistanche deserticola Ma, a perennial parasitic herb of family Orobanchaceae, is mainly parasitic on the roots of the Haloxylon ammodendron Bunge. In view of this special parasitic relationship, we applied random forest (RF) model to forecast potential geographic distribution, and developed a comprehensive habitat suitability model by integrating bioclimatic and soil factors to assess the suitable distribution of C. deserticola and H. ammodendron across China in 2050s and 2070s under RCP2.6, RCP4.5, and RCP8.5, respectively. We modeled the core potential geographic distribution of C. deserticola by overlaying the distribution of these two species, and analyzed the spatial distribution pattern and migration trend of C. deserticola by using the standard deviational ellipse. In addition, we evaluated the accuracy of RF model through three evaluation indexes, and analyzed the dominant climate factors. The results showed that the core potential distribution areas of C. deserticola are distributed in the Xinjiang Uygur Autonomous Region, the junction of Shaanxi–Gansu–Ningxia provinces, and the Inner Mongolia Autonomous Region. The spatial dispersion would intensify with the increasing of emission scenarios, and the geographical habitat is moving towards higher latitude. Among the three evaluation indexes, the area under the ROC curve (AUC) and True Skill Statistic (TSS) have better assessment results. The main bioclimatic factors affecting the distribution are min temperature of coldest month (Bio6), annual precipitation (Bio12), precipitation of wettest month (Bio13), precipitation of wettest quarter (Bio16), and precipitation of warmest quarter (Bio18), among which the importance of precipitation factors is greater than temperature factors. More importantly, the results of this study could provide some guidance for the improvement of desert forest system, the protection of endangered species and the further improvement of the ecological environment.