Foster took over from Steve Hansen after the 2019 World Cup.
In this time in charge the All Blacks have won the Bledisloe Cup twice, as well as last year's Rugby Tri-Nations.
He has also welcomed 13 new All Blacks into the fold.
NZR chief executive Mark Robinson said Foster could now plan for next year and beyond with certainty.
"Ian has faced extraordinary times since he was first appointed, with the uncertainty of Covid-19 and the numerous challenges it has thrown up, and he's shown remarkable composure and resolve to lead incredibly well through it all," Robinson said.
NZR had also started work on contracting the rest of Foster's coaching staff and management team, he said.
"Foz has built an outstanding culture and environment in the team with an inclusive and collaborative approach and maintained a steady, clear focus on our goal of being number one in the world again.
"There is no doubt Foz and his team are performing extremely well in trying conditions and we are pleased to send a strong signal of support to create certainty in our environment and allow the management team and player group to plan for the future.
Foster said he felt privleged to be coaching the side.
"I don't take that for granted ...it's clearly been a challenging couple of years with Covid-19, but I've been hugely proud of the resilience shown by the team. I'm personally driven to have our team continue to succeed as we build to Rugby World Cup 2023," Foster said.
"What is equally important to me is the fact that I'm just one part of an outstanding coaching and management team and to continue working with them is a privilege and inspires me to be the best head coach I can be.
"We have the immediate challenge of this year's Rugby Championship and then the tour north, but 2022 and 2023 will bring their own challenges. I'm really excited to be leading the team into the future and can't wait to get stuck into our work."