Under anaerobic conditions, bacteria may utilize nitrates and nitrites as electron acceptors. Sensitivity to nitrous compounds is achieved via several mechanisms, some of which rely on sensor histidine kinases (HKs). The best studied nitrate- and nitrite-sensing HKs (NSHKs) are NarQ and NarX from Escherichia coli. Here, we review the function of NSHKs, analyze their natural diversity, and describe the available structural information. In particular, we show that around 6000 different NSHK sequences forming several distinct clusters may now be found in genomic databases, comprising mostly the genes from Beta- and Gammaproteobacteria as well as from Bacteroidetes and Chloroflexi, including those from anaerobic ammonia oxidation (annamox) communities. We show that the architecture of NSHKs is mostly conserved, although proteins from Bacteroidetes lack the HAMP and GAF-like domains yet sometimes have PAS. We reconcile the variation of NSHK sequences with atomistic models and pinpoint the structural elements important for signal transduction from the sensor domain to the catalytic module over the transmembrane and cytoplasmic regions spanning more than 200 Å.