The innate immune response was once considered to be a limited set of responses that aims to contain an infection by primitive "ingest and kill" mechanisms, thus giving the host time to mount a more specific humoral and cellular immune response. It is now known that the innate immune response is a complex integrated response involving multiple players that work together to eliminate the pathogen. The fruit fly has been a great model to decipher various aspects of the immune response of invertebrates, including the transcriptional regulation of the antimicrobial genes during systemic response. Various reports have recently shown that Drosophila can also be used as a model system to study the mechanisms that control epithelial immune responses and more specifically gut immunity. We will present here our current knowledge on the genetic control of antimicrobial peptides production and recent progress made in our comprehension of the mechanisms through which Drosophila gut epithelium tolerates commensal microbiota yet remains able to mount an efficient immune response to food-borne pathogens.