Hannah, 34, broke Matlock’s goalscoring record in 2010/11 with 52 goals, and scored a total of 90 goals for the club between 2009 and 2011.
He spent his youth football with both Sheffield Wednesday and Sheffield United, and has since featured for the likes of Bradford City, Chester, Barrow, Gainsborough Trinity and Grimsby Town.
He joins the Proctor Cars Stadium side from Cleethorpes Town.
“I’m really happy to have the opportunity to come back to Matlock where I enjoyed a good spell before my move into the pro game," said Hannah.
"As soon as I spoke to the gaffer it felt right, I was really impressed with what he had to say and his ambitions. Matlock was a great club for me and I thoroughly enjoyed my time there.
"Obviously it’s been a while and it will be good to see some old faces again. It feels the right move for me for so many reasons. I always felt I’d come back but you never know in football, it can take you in all sorts of directions but I’m so glad the opportunity has come around and I can’t wait to get going, I’m sure everyone else is the same.
"Hopefully I can continue from where I left off all those years ago but probably won’t get the 52 goals I finished with, not this season anyway!"