Cephalexin can be used to treat mild pyelonephritis, a kidney infection. More severe kidney infections will require IV antibiotics.