Influenza virus gains entry into the body by inhalation and initiates its replication cycle within the lung. The early stage of infection, while the virus is confined to the lung mucosa, provides the ideal window of opportunity for an effective immune response to control the infection. Tissue-resident memory (Trm) CD8 T cells, located in a variety of tissues including the lung, are ideally situated to act during this window and stall the infection. The factors involved in the differentiation of lung Trm cells remain poorly defined. We demonstrate that recognition of antigen presented locally by dendritic cells (DCs) and transforming growth factor-β (TGFβ) signaling are both required. We exploited this knowledge to develop an antibody-targeted vaccination approach to generate lung Trm cells. Delivering antigen exclusively to respiratory DCs results in the development of lung CD8 Trm cells that are highly protective against lethal influenza challenge. Our results describe an effective vaccination strategy that protects against influenza virus infection.