Hill, sacked by Barnsley last month, was the most successful manager in the Spotland club's history.
He took them to the League Two play-off final in 2007-8, the play-offs the following year but in 2009-10 he guided them to automatic promotion.
After a mid-table finish in League One, he left for Barnsley in May 2011 but was sacked as Tykes boss in December.
He replaces John Coleman, who was sacked on Monday after a disappointing run of results, in the Rochdale hotseat.
"When the club approached me about coming back to Spotland I didn't hesitate," Hill told the club's website.
"Rochdale Football Club will, and always will remain dear to me, and to be honest it was a no-brainer.
"I'll be here until the end of the season and we will take stock of the situation then. Until then we have an 18 game season to think about, to plan and to achieve so that's what I, the players and staff will be doing.
"We also need the fans to get behind us and give us all your support - that is crucial if we are going to go forward."
Chairman Chris Dunphy added: "This is not a position we, as a club, would like to have found ourselves in, but after a recent run of poor form it was important that we acted now.
"I am delighted that Keith has decided to take the job and I am confident in his experience and his ability to work and develop our current squad."