Parasite adaptation to dynamic host characteristics is a recurrent theme in biology. Diversity-generating retroelements (DGRs) are a newly discovered family of genetic elements that function to diversify DNA sequences and the proteins they encode. The prototype DGR was identified in a temperate bacteriophage, BPP-1, on the basis of its ability to generate variability in a gene that specifies tropism for receptor molecules on host Bordetella species. Tropism switching is a template-dependent, reverse transcriptase mediated process that introduces nucleotide substitutions at defined locations within a target gene. This cassette-based mechanism is theoretically capable of generating trillions of different amino acid sequences in a distal tail fiber protein, providing a vast repertoire of potential ligand–receptor interactions. Variable residues are displayed in the context of a specialized C-type lectin fold, which has evolved a unique solution for balancing protein diversity against structural stability. Homologous DGRs have been identified in the chromosomes of diverse bacterial species. These unique genetic elements have the potential to confer powerful selective advantages to their hosts, and their ability to generate novel binding specificities and dynamic antimicrobial agents suggests numerous applications.