The Frenchman replaces Santiago Solari, who was in charge for less than five months.
Former Real midfielder Zidane, 46, who left in May after leading the club to a third straight Champions League trophy, has agreed to take over until 2022, the club announced.
Real are currently third in La Liga, 12 points behind leaders Barcelona.
Solari was sacked after a 4-1 win over Real Valladolid on Sunday – which followed a shock Champions League exit to Ajax.
That 4-1 home defeat and 5-3 aggregate loss to the Dutch side was the final straw for Real president Florentino Perez.
Zidane stepped down following the Champions League final victory over Liverpool, and Julen Lopetegui was hired as his successor just before the World Cup where he had been due to lead Spain, who promptly sacked him.
Four and a half months later it was Real’s turn to fire him.
Reserve-team boss Solari came in as caretaker before being given a contract to 2021 on 13 November.
What job faces Zidane at Real?
Despite returning less than a year after he left the club, Zidane faces a rebuilding job at Real Madrid after their Champions League dynasty came to a remarkable, humiliating end last week.
They have not adequately replaced Cristiano Ronaldo, who left for Juventus in the summer, with Karim Benzema the only Real player to reach double figures in La Liga (13). He has scored 22 goals in all competitions, with Gareth Bale on 13 and Sergio Ramos on 11.
None of those players have certain futures at Real, with captain Ramos, who has been at Real for 14 years, reportedly falling out with president Perez. Wales forward Bale is expected to leave because of a fractious relationship with the club’s fans – who have booed him recently – and players.
Other stalwarts of recent glory like Marcelo and Toni Kroos have struggled too.