Diversity-generating retroelements (DGRs) are DNA diversification machines found in diverse bacterial and bacteriophage genomes that accelerate the evolution of ligand-receptor interactions. Diversification results from a unidirectional transfer of sequence information from an invariant template repeat (TR) to a variable repeat (VR) located in a protein-encoding gene. Information transfer is coupled to site-specific mutagenesis in a process called mutagenic homing, which occurs through an RNA intermediate and is catalyzed by a unique, DGR-encoded reverse transcriptase that converts adenine residues in the TR into random nucleotides in the VR. In the prototype DGR found in the Bordetella bacteriophage BPP-1, the variable protein Mtd is responsible for phage receptor recognition. VR diversification enables progeny phage to switch tropism, accelerating their adaptation to changes in sequence or availability of host cell-surface molecules for infection. Since their discovery, hundreds of DGRs have been identified, and their functions are just beginning to be understood. VR-encoded residues of many DGR-diversified proteins are displayed in the context of a C-type lectin fold, although other scaffolds, including the immunoglobulin fold, may also be used. DGR homing is postulated to occur through a specialized target DNA-primed reverse transcription mechanism that allows repeated rounds of diversification and selection, and the ability to engineer DGRs to target heterologous genes suggests applications for bioengineering. This chapter provides a comprehensive review of our current understanding of this newly discovered family of beneficial retroelements.