Defending champions Spain will play Russia and Ecuador in the Davis Cup in November, after the draw was made in London on Thursday.
Spain won the first edition of the reformed tournament in Madrid four months ago, when Rafael Nadal powered them to victory with a 2-0 win in the final against Canada.
Canada have been placed in Group B with Kazakhstan and Sweden while 10-time winners France will take on Great Britain and the Czech Republic in Group C.
Serbia will be up against Germany and Austria in Group F, which could mean singles showdowns between Novak Djokovic, Alexander Zverev and Dominic Thiem.
The United States have again been drawn alongside Italy, with Colombia completing Group E. Croatia, Australia and Hungary make up Group D.
It will be the second Davis Cup finals in Madrid after the change of format last year, which swapped the traditional spread of four three-day ties across 10 months, with one week of competition.
The 12 teams are due to contest the finals at the Caja Magica from 23 to 29 November.