The draw was approved by the Caf Executive Committee at its meeting on Thursday, 12 January 2017 in Libvreville, Gabon.
Gernot Rohr’s men were thrown in a semi-tough group that has former winners, Bafana Bafana - in Group E.
According to the Confederation of African Football, the winners of each group qualify for the championship plus the best three runners-up in all groups.
The Super Eagles will be hoping to stage a return to the tournament after back-to-back blackouts in Equatorial Guinea 2015 and Gabon 2017. South Africa denied Nigeria a place in the 2015 edition following their 2-2 draw in the last game of the qualifying series at the Godswill Akpabio International Stadium.