Protective immunoglobulin A (IgA) responses to oral antigens are usually orchestrated by gut dendritic cells (DCs). Here, we show that lung CD103(+) and CD24(+)CD11b(+) DCs induced IgA class-switch recombination (CSR) by activating B cells through T cell-dependent or -independent pathways. Compared with lung DCs (LDC), lung CD64(+) macrophages had decreased expression of B cell activation genes and induced significantly less IgA production. Microbial stimuli, acting through Toll-like receptors, induced transforming growth factor-β (TGF-β) production by LDCs and exerted a profound influence on LDC-mediated IgA CSR. After intranasal immunization with inactive cholera toxin (CT), LDCs stimulated retinoic acid-dependent up-regulation of α4β7 and CCR9 gut-homing receptors on local IgA-expressing B cells. Migration of these B cells to the gut resulted in IgA-mediated protection against an oral challenge with active CT. However, in germ-free mice, the levels of LDC-induced, CT-specific IgA in the gut are significantly reduced. Herein, we demonstrate an unexpected role of the microbiota in modulating the protective efficacy of intranasal vaccination through their effect on the IgA class-switching function of LDCs.