The transition to tissue residency altered macrophage function, and GATA6+ tissue-resident macrophages were required for host resistance to nematode infection. Here, GATA6 is linked to Nematoda infectious disease.