The former Ireland Wolfhounds coach will work alongside the Scotstoun chief and deputies Matt Taylor and Kenny Murray as he oversees the Warriors forwards.
The former prop, who made over 100 appearances for Connacht from 2000 to 2006, has also played for Richmond and Stade Francais.
McFarland was appointed forwards coach at the Sportsground in 2006 and then assistant coach in 2010, helping the Irish Province to become one of the Guinness Pro12's most consistent performers.
Dark days inspired Al Kellock Glasgow uccess
In 2007, McFarland also linked up with Eric Elwood to guide the Ireland Under-20s to a grand slam of victories in the Six Nations Championship.
Townsend said: "Dan has done a fantastic job at Connacht over the last nine years and is a high-quality technical coach.
"He has an excellent reputation and we believe that he will play a key role in helping to develop a number of our younger players, which he has done really well at Connacht.
"It's great news that he's joining us and I'm sure he will be an excellent addition to our coaching team next season."
McFarland added: "Connacht has been such a large part of my life for such a long time, but I'm excited about this next stage of my career.
"Glasgow regularly finish in the top four in the Pro12 and have made huge progress over the last few seasons, reaching their first major final last year.
"I'm looking forward to moving to Glasgow with my family at the end of the season and working with the players and coaches over the summer, to prepare for the new campaign."
Gregor Townsend after semi-final repeat
Shoulder injury ends Matt Scott's season