The availability of complete genome sequence from 12 Drosophila species presents the opportunity to examine how natural selection has affected patterns of gene family evolution and sequence divergence among different components of the innate immune system. We have identified orthologs and paralogs of 245 Drosophila melanogaster immune-related genes in these recently sequenced genomes. Genes encoding effector proteins, and to a lesser extent genes encoding recognition proteins, are much more likely to vary in copy number across species than genes encoding signaling proteins. Furthermore, we can trace the apparent recent origination of several evolutionarily novel immune-related genes and gene families. Using codon-based likelihood methods, we show that immune-system genes, and especially those encoding recognition proteins, evolve under positive darwinian selection. Positively selected sites within recognition proteins cluster in domains involved in recognition of microorganisms, suggesting that molecular interactions between hosts and pathogens may drive adaptive evolution in the Drosophila immune system.