The house fly, Musca domestica, occupies an unusual diversity of potentially septic niches among sequenced Dipteran insects and is a vector of numerous diseases of humans and livestock. In the present study, we apply whole-transcriptome sequencing to identify genes whose expression is regulated in adult flies by bacterial infection. We then combine the transcriptomic data with analysis of rates of gene duplication and loss to provide insight into the evolutionary dynamics of immune-related genes. Genes up-regulated after bacterial infection are biased toward being evolutionarily recent innovations, suggesting the recruitment of novel immune components in the M. domestica or ancestral Dipteran lineages. In addition, using new models of gene family evolution, we show that several different classes of immune-related genes, particularly those involved in either pathogen recognition or pathogen killing, are duplicating at a significantly accelerated rate on the M. domestica lineage relative to other Dipterans. Taken together, these results suggest that the M. domestica immune response includes an unusual diversity of genes, perhaps as a consequence of its lifestyle in septic environments.