Foster replaces Steve Hansen at the helm of New Zealand on a two-year deal beginning in 2020, New Zealand Rugby (NZR) announced.
The 54-year-old has been an All Blacks assistant coach since 2012.
"The NZR board has today ratified Ian Foster as the new head coach of the All Blacks from 2020," NZR chairman Brent Impey said in a statement.
"He brings world-class international experience to the role, an incredibly strong coaching team, and we think he'll do an outstanding job.
"The interview process was extensive and really difficult, which reflects the very strong applications from both candidates."
Foster was delighted to take the job, with Crusaders head coach Scott Robertson having also been interviewed.
"I feel truly privileged and honoured to be given this opportunity and I can't wait to lead the team into the next chapter of what is a remarkable legacy," he said.
"I'm incredibly proud of what we have achieved in the All Blacks over the last eight years and I'm excited and energised by a new coaching team who will join me.
"It's incredibly humbling to be appointed to the job and I have a strong desire to serve the jersey well and represent New Zealand to the best of my ability."