O'Hanlon, 30, who arrived at Brunton Park for a trial period just before Christmas, will be included in manager Greg Abbott's squad for Sunday's home clash with Coventry.
"He knows some of the lads anyway and has fitted in well," Abbott told the club's official website. "We've seen a lot of him and we're delighted that we've been able to bring him in.
"He's a big, strong player who has a lot of experience and games under his belt. We're really looking forward to working with him."
O'Hanlon started his career at Everton and following his release in 2004 moved on to Swindon, where he made over 100 appearances before joining MK Dons in 2006.
He made nearly 200 appearances for the Dons during a five-year spell and then moved north of the border with Hibernian in the summer of 2011.