The innate immune response is the first line of defense against microbial infections in both insects and mammals. Systematic analysis of the innate immune response in the model organism Drosophila melanogaster has provided important insights into the mechanisms of pathogen recognition and host response. Recognition of pathogen-associated molecules, such as peptidoglycans, stimulates the Toll and immune deficiency (Imd) pathways to induce antimicrobial responses. The Toll and Imd pathways are homologous to the mammalian Toll-like receptor (TLR) and tumor necrosis factor receptor (TNFR) signaling pathways, respectively, and are essential for Drosophila to survive infection. In this Review, we will discuss the recent genetic, genomic and RNA interference analyses that have unveiled additional intricacy in the Toll and Imd pathways.