Gordon Strachan’s side will kick off their quest to reach a first major finals in 18 years on 7 September at the Westfalenstadion.
Scottish Football Association chief executive Stewart Regan tweeted: “The German FA have now confirmed that Scotland will play Germany on 7th Sept in Dortmund. Get your flights sorted quickly! #comeonscotland”
The Scots last visited Germany in September 2003, when they also played in Dortmund. On that occasion, the hosts won 2-1 with goals from Fredi Bobic and Michael Ballack before Neil McCann pulled one back for Berti Vogts’ side.
Scotland will also take on Georgia, Poland, the Republic of Ireland and Gibraltar in Group D as they aim to reach the European Championship in France.
Dortmund take on Real Madrid in the Champions League quarter-finals, after the draw was made earlier today.