The Dumfries-born player is returning to his farming roots after studying at Scotland’s Rural College.
“It’s time to hang up the boots and pull on the wellies,” he wrote in a post on Instagram.
A dynamic centre who could play at 12 or 13, he made his Scotland debut against Samoa in the quadrangular summer tournament in South Africa in 2013, and scored his first international try the next week against Springboks in Nelspruit.
He suffered more than his fair share of injuries and was particularly unfortunate in 2015 when a knee injury on the eve of the Calcutta Cup ruled him out of the match at Twickenham and the Rugby World Cup later that year.
He recovered and forced his way back into the Scotland side and enjoyed notable Six Nations wins over France (2016), Ireland and Wales (both 2017), scoring a memorable try from a lineout against the Irish at Murrayfield.
He also played in the 24-19 win over Australia in 2017. It was just the third time that Scotland had beaten the Wallabies on their own patch and Dunbar, playing at inside centre, linked up well with Duncan Taylor at 13 and Finn Russell at 10 in an impressive midfield.
His final cap came as a replacement in the home win over Argentina in November 2018, the only time he played for Scotland as a substitute.
Originally from Johnstonebridge, near Lockerbie, the 31-year-old grew up on the family farm and came through the ranks at Annan Rugby Club. He moved to Selkirk before signing a professional contract with Glasgow Warriors for whom he played 119 times.
Matt Fagerson’s try-scoring return is good news for Glasgow Warriors and Scotlan…
Dunbar was the only Scot to be included in the Pro12 Dream Team for the 2013-14 season and was part of the Glasgow squad which won the Pro12 the following year, although the knee injury ruled him out of the final against Munster in Belfast.
He was released by Glasgow in 2019 and had spells playing top-flight rugby in England and France with Newcastle and Brive before deciding to call time on his career.
“Feel extremely grateful to have had such an amazing journey with my rugby career,” he said.
“As a teenager growing up on the farm and playing rugby for fun I’d never have imagined what it would lead to. I’ve been honoured to represent my country, play with and learn from legends of the game, travel to places I’d never have had the opportunities to before, and most importantly make friendships that will last a lifetime.
“Unfortunately, my career has had to come to an end sooner than hoped due to injury but I’m happy and ready to move on to the next chapter of life with my family.”
Dunbar will now focus on a career in farming.
While in France, he had studied for an HND in agriculture by distance learning, having previously graduated in 2008 with an HNC from the Scottish Agricultural College in Ayrshire.