The Scotstoun side - who face rivals Edinburgh in the first leg of the 1872 Cup on Boxing Day - have secured the 23-year-old Scotland centre until May 2017.
He is the third player in recent weeks to have agreed a new deal after fellow centre Mark Bennett and stand-off Finn Russell were also rewarded for their promising displays.
Dunbar, who has three caps for Scotland, has made 42 appearances in the RaboDirect PRO12, seven in the Heineken Cup and is set to make his 50th appearance for the club against the Gunners at Murrayfield on Thursday.
He won his first Scotland cap against Samoa in the opening match of this year's summer tour to South Africa and dotted down his first try for his country the following week against the Springboks.
Dunbar said: "I'm very happy to be staying at Scotstoun for the next three years. My game has really developed since I signed a professional contact with the club and I'm enjoying working with the coaches and players we have here.
"I'm still young so I've got a lot to learn and I want to continue to work hard to develop my game.
"It was a real honour to make my Scotland debut in the summer and playing for the Warriors made that possible.
"I am very ambitious and I want to win things in Glasgow and I believe we have a squad capable of doing that.
"There are a lot of internationals at Scotstoun and that is a great environment to be playing in as it pushes you on to become a better player."
Townsend added: "This is a really good signing for the club.
"Alex is someone that's been here for a few years and has progressed year-on-year and is now a test-level player.
"What he does really well is catch the ball at pace and he's very strong in contact. He's developing his passing game and is one of our best defensive players, so I'm absolutely delighted that he's signed on for three more years.
"The future of this club is not just about what's happening over the next six months but about the next few years.
"It's important we sign and re-sign the players we believe can take this club forward and Alex is certainly one of those players."