Metazoans protect themselves from environmental toxins and virulent pathogens through detoxification and immune responses. We previously identified a small molecule xenobiotic toxin that extends survival of Caenorhabditis elegans infected with human bacterial pathogens by activating the conserved p38 MAP kinase PMK-1 host defense pathway. Here we investigate the cellular mechanisms that couple activation of a detoxification response to innate immunity. From an RNAi screen of 1,420 genes expressed in the C. elegans intestine, we identified the conserved Mediator subunit MDT-15/MED15 and 28 other gene inactivations that abrogate the induction of PMK-1-dependent immune effectors by this small molecule. We demonstrate that MDT-15/MED15 is required for the xenobiotic-induced expression of p38 MAP kinase PMK-1-dependent immune genes and protection from Pseudomonas aeruginosa infection. We also show that MDT-15 controls the induction of detoxification genes and functions to protect the host from bacteria-derived phenazine toxins. These data define a central role for MDT-15/MED15 in the coordination of xenobiotic detoxification and innate immune responses.