Bayern, who have won the competition each of the past two seasons, will play Kiel in the second round on December 22 or 23.
It will be the European champions' seventh game in December and their 25th since the season started in mid-September.
There were three all-Bundesliga ties, with Augsburg hosting RB Leipzig, last season's runners-up Bayer Leverkusen at home to Eintracht Frankfurt, and Stuttgart playing Freiburg in a south-west derby.
Borussia Dortmund are away to second division Eintracht Braunschweig.
Both top-tier teams Schalke and Borussia Moenchengladbach face tricky ties away to fourth-tier clubs Ulm and Elversberg respectively.
The German Cup final is scheduled to take place at Berlin's Olympic Stadium on May 13.