He told the club website: "People who know me know that I will give my all for the club."
Chairman Mike Rance added: "The board is extremely happy to have extended Keith's contract."
Alexander took charge at the Moss Rose in February 2008 following the departure of Ian Brightwell as manager.
My next job is to continue talks with the players about their futures at the club
Keith Alexander
And he said he was eager to build on the foundations he has laid in almost two years at the club.
"There is nothing worse than players and managers coming and going and never able to settle and gel together and now we have stability and a real opportunity to build," said Alexander.
"My next job is to continue talks with the players about their futures at the club.
"We've got some talented players here. A few times this season we've thought we were capable of wins like that against Crewe, but not always been getting what we've deserved, and we are all confident that we can kick on from here and build for the future."
Source: BBC Sport
Source: BBC Sport