The detection of pathogens through nucleic acid sensors is a defining principle of innate immunity. RNA-sensing and DNA-sensing receptors sample subcellular compartments for foreign nucleic acids and, upon recognition, trigger immune signalling pathways for host defence. Over the past decade, our understanding of how the recognition of nucleic acids is coupled to immune gene expression has advanced considerably, particularly for the DNA-sensing receptor cyclic GMP-AMP synthase (cGAS) and its downstream signalling effector stimulator of interferon genes (STING), as well as the molecular components and regulation of this pathway. Moreover, the ability of self-DNA to engage cGAS has emerged as an important mechanism fuelling the development of inflammation and implicating the cGAS-STING pathway in human inflammatory diseases and cancer. This detailed mechanistic and biological understanding is paving the way for the development and clinical application of pharmacological agonists and antagonists in the treatment of chronic inflammation and cancer.