Background: Magnesium (Mg2+), the second most abundant cation in the cell, is woven into a multitude of cellular functions. Dysmagnesemia is associated with multiple diseases and, when severe, can be life-threatening. Summary: This review discusses Mg2+ homeostasis and function with specific focus on renal Mg2+ handling. Intrarenal channels and transporters related to Mg2+ absorption are discussed. Unraveling the rare genetic diseases with manifestations of dysmagnesemia has greatly increased our understanding of the complex and intricate regulatory network in the kidney, specifically, functions of tight junction proteins including claudin-14, -16, -19, and -10; apical ion channels including: TRPM6, Kv1.1, and ROMK; small regulatory proteins including AC3 and ANK3; and basolateral proteins including EGF receptor, γ-subunit (FXYD2) of Na-K-ATPase, Kir4.1, CaSR, CNNM2, and SLC41A. Although our understanding of Mg2+ handling of the kidney has expanded considerably in the last two decades, many questions remain. Future studies are needed to elucidate a multitude of unknown aspects of Mg2+ handling in the kidney. Key Message: Understanding rare and genetic diseases of Mg2+ dysregulation has expanded our knowledge and furthers the development of strategies for preventing and managing dysmagnesemia.