Fitness responses to environment can shape species distributions, though opposing eco-evolutionary processes can obscure environmental effects. For example, host specificity influences parasite dynamics, but is unclear how adaptation of parasites to local host communities may scale up to continental distributions. Here, we develop a macroecological framework to determine how host community structure affects the distribution of specialist and generalist populations of Striga hermonthica, an African parasitic plant of cereal crops. Combining data from global crop production and parasite experimental trials, we find that parasites perform best on the host species that is most common in their location of origin. Moreover, niche model contrasts predict parasite specialization on two hosts that evolved alongside Striga during domestication (pearl millet and sorghum), indicating that specialist parasites may be most likely to occur where host niches differ most in multivariate environmental space. Our study demonstrates that patterns of parasite local adaptation to host communities can emerge at continental scales and that differential environmental tolerances of hosts indirectly shape the distribution of specialist and generalist parasites. By predicting spatial dynamics of parasite specialization versus generalization directly from environmental data, our approach may help inform current and future management of pests and disease.