The first, on the A77 at Maybole in Ayrshire, starts on Monday, with Largs, Biggar, Langholm and Oban to follow.
The move is the first involving trunk roads in Scotland other than around schools.
Compulsory 20mph limits are already in force in parts of towns and cities such Edinburgh and Cromarty in the Highlands. They are on roads which are the responsibility of local authorities.
Edinburgh plans to extend its 20mph zone from much of the south side to the rest of the city from next year. Doing the same for trunk roads, which are run by the Scottish Government, follows calls for their speed limits through towns to be lowered from 30mph.
South Ayrshire councillor John McDowall said: “Maybole has a narrow main street and this coupled with very high volumes of traffic means there are real concerns about road safety.
“I am sure pedestrians and cyclists will appreciate the new speed restrictions, and motorists should understand the overarching policy is to keep people safe.”
Transport Scotland national operations manager Stewart Leggett said: “These pilot zones will help us establish the benefits of lowering speeds in towns and villages, where it is reasonable to do so.
“We expect the pilot sites to improve road safety generally while bringing specific benefits for vulnerable road users, such as older people and cyclists.
“We are pleased the wider consultation process is now complete in Maybole and will now monitor the benefits it brings.”
Chief Superintendent Iain Murray, head of road policing for Police Scotland, said: “This will be the first full-time 20mph limit on a trunk road and we shall liaise closely with Transport Scotland to assess the outcome and benefits of its introduction.”
The Institute of Advanced Motorists said by-passes rather than lower speed limits were the answer.
Policy and research director Neil Greig said: “Detailed information on the exact extent of 20mph limits is not properly recorded so it is difficult to judge their true effectiveness.
“Squeezing long-distance car and lorry traffic through historic village high streets always requires compromise, and these new limits will make things better for residents.
“However, the only long-term solution for each town is a by-pass. In places like Maybole, a by-pass has been talked about for decades and progress must be accelerated.”
However, Stuart Hay, Scotland director of Living Streets, which campaigns for pedestrians, said: “20mph zones are the single biggest measure that will reduce road danger and improve the walking environment.
“Evidence suggests 20mph zones are popular when they come into force and are especially important to vulnerable road users. Well done to Transport Scotland and the communities that have campaigned for lower speed limits.
“This is the first time such a limit will be introduced to a trunk road in Scotland and it will bring major improvements to the walking environment. We look forward to the results of this pilot and hope it will support further roll out across the trunk road network.”