The former Manchester United and England goalkeeper played a pivotal role in the latter stages of Wrexham's 2022-23 National League title-winning campaign and will now extend his stay at the club until the end of the 2023-24 season.
"At the end of last season it was obvious that I enjoyed being at the club," Foster said in a statement. "I loved being part of the team and everything that Wrexham stands for.
"The fans took to me so warmly, Phil Parkinson is brilliant, Steve Parkin is top class, I love Aidan Davison to bits, and the Co-Chairmen are out of this world.
"I'd decided before the end of last season I wanted to do it, because it feels like home. I've never joined a football club and felt at ease so quickly."
The 40-year-old came out of retirement to join the Hollywood-owned club in March after injuries to Mark Howard and Rob Lainton left the team in need of a new goalkeeper.
Foster quickly became a crucial figure for his new side and dramatically saved a 97th-minute penalty against promotion rivals Notts County to put Wrexham on course for the title.
The goalkeeper will now extend his playing career with Wrexham as the club returns to the English Football League for the first time since 2008.