The widespread bacterial second messenger cyclic diguanylate (c-di-GMP) regulates a variety of processes, including protein secretion, motility, cell development, and biofilm formation. c-di-GMP-dependent responses are often mediated by its binding to the cytoplasmic receptors that contain the PilZ domain. Here, we present comparative structural and sequence analysis of various PilZ-related domains and describe three principal types of them: (i) the canonical PilZ domain, whose structure includes a six-stranded beta-barrel and a C-terminal alpha helix, (ii) an atypical PilZ domain that contains two extra alpha helices and forms stable tetramers, and (iii) divergent PilZ-related domains, which include the eponymous PilZ protein and PilZN (YcgR_N) and PilZNR (YcgR_2) domains. We refine the second c-di-GMP binding motif of PilZ as [D/N]hSXXG and show that the hydrophobic residue h of this motif interacts with a cluster of conserved hydrophobic residues, helping maintain the PilZ domain fold. We describe several novel PilZN-type domains that are fused to the canonical PilZ domains in specific taxa, such as spirochetes, actinobacteria, aquificae, cellulose-degrading clostridia, and deltaproteobacteria. We propose that the evolution of the three major groups of PilZ domains included (i) fusion of pilZ with other genes, which produced Alg44, cellulose synthase, and other multidomain proteins; (ii) insertion of an ϳ200-bp fragment, which resulted in the formation of tetramer-forming PilZ proteins; and (iii) tandem duplication of pilZ genes, which led to the formation of PilZ dimers and YcgR-like proteins. IMPORTANCE c-di-GMP is a ubiquitous bacterial second messenger that regulates motility, biofilm formation, and virulence of many bacterial pathogens. The PilZ domain is a widespread c-di-GMP receptor that binds c-di-GMP through its RXXXR and [D/N]hSXXG motifs; some PilZ domains lack these motifs and are unable to bind c-di-GMP. We used structural and sequence analysis to assess the diversity of PilZ-related domains and define their common features. We show that the hydrophobic residue h in the second position of the second motif is highly conserved; it may serve as a readout for c-di-GMP binding. We describe three principal classes of PilZ-related domains, canonical, tetramer-forming, and divergent PilZ domains, and propose the evolutionary pathways that led to the emergence of these PilZ types.