It will be the 39-year-old's second spell at the Racecourse Ground after a loan stint with the Welsh outfit in 2005.
Foster hung up his gloves last year after a distinguished career that included lengthy periods with West Brom and Watford.
Wrexham sounded him out about a return to action after losing regular keeper Rob Lainton to injury.
Foster admits he is pleased to be back.
"I'm over the moon," he told the club's website. "I've been at the club an hour this morning and it seems a really nice place. Everyone is down to earth and the manager's top class.
"It's changed a lot since I was last here, but it's nice to be back and it's nice to be back as a player too. It will be interesting to see how my body feels after training today! I'm looking forward to getting started."
Foster boasts a wealth of experience having made more than 500 first-team appearances and earned eight England caps.
He first played for Wrexham on loan from Stoke, and helped the club to win the LDV Vans Trophy, before moving on to United and later Watford, Birmingham and West Brom.
He made 26 appearances for the Hornets in the Premier League last season.
With Lainton ruled out for around six weeks, manager Phil Parkinson feels he is an excellent acquisition.
He said: "We're delighted to welcome Ben to the club. With Rob Lainton getting injured at the weekend it was important we had all bases covered going into the last part of the season, which this signing ensures."
Wrexham, owned by actors Ryan Reynolds and Rob McElhenney, are three points clear at the top of the National League.
Read more: Euro 2024 qualifier: Italy vs England verdict, predicted score, key stats and suggested bets