Gastrointestinal nematodes are a global cause of disease and death in humans, wildlife and livestock. Livestock infection has historically been controlled with anthelmintic drugs, but the development of resistance means that alternative controls are needed. The most promising alternatives are vaccination, nutritional supplementation and selective breeding, all of which act by enhancing the immune response. Currently, control planning is hampered by reliance on the faecal egg count (FEC), which suffers from low accuracy and a nonlinear and indirect relationship with infection intensity and host immune responses. We address this gap by using extensive parasitological, immunological and genetic data on the sheep-Teladorsagia circumcincta interaction to create an immunologically explicit model of infection dynamics in a sheep flock that links host genetic variation with variation in the two key immune responses to predict the observed parasitological measures. Using our model, we show that the immune responses are highly heritable and by comparing selective breeding based on low FECs versus high plasma IgA responses, we show that the immune markers are a much improved measure of host resistance. In summary, we have created a model of host-parasite infections that explicitly captures the development of the adaptive immune response and show that by integrating genetic, immunological and parasitological understanding we can identify new immune-based markers for diagnosis and control.