Celtic will travel to either Latvia or San Marino in the third qualifying round of the Europa League.
The Scottish champions will play the winners of Riga or Tre Fiori on September 24.
Neil Lennon's side enter the Europa League at this stage after losing their Champions League second qualifying round tie against Ferencvaros last week.
Rangers will travel to either Luxembourg's Progres Niederkorn or Dutch side Willem II if they beat Gibraltar's Lincoln Reds in their second round qualifying game.
The Glasgow giants have played Progres twice in the past three seasons and have not won either away tie.
Pedro Caixinha's team suffered an embarrassing 2-0 defeat in Luxembourg in July 2017 which sent them crashing out 2-1 on aggregate in the first qualifying round in 2017-18.
With Steven Gerrard at the helm, Rangers exacted revenge with a 2-0 first-leg victory last year, but they were held to a goalless draw in the second leg.
Aberdeen will visit Portugal's Sporting Lisbon – who have beaten Scottish opposition just once in seven attempts – should they progress past Norway's Viking.
Motherwell or Coleraine's third qualifying round opponents will be Albanian side KF Laci or Hapoel Be'er-Sheva, of Israel.
Be'er Sheva ran Brendan Rodgers' Celtic side close in the Champions League play-offs four seasons ago, winning the return leg in Israel 2-0 after losing 5-2 at Parkhead.
Tottenham will visit Botosani of Romania or Shkendija of Macedonia, should they see off Bulgarian outfit Lokomotiv Plovdiv.
Welsh sides were also well represented in the draw with champions Connah's Quay Nomads handed an away tie against Icelandic outfit KI Klaksvik should they eliminate Dinamo Tbilisi.
Bala will entertain Serbia's FK Vojvodina should they beat Standard Liege, while The New Saints' reward for beating B36 Torshavn would be a trip to CSKA Sofia or Bate Borisov.
Northern Ireland's Linfield will be at home to Flora Tallinn or KR Rejkavik if they get past Floriana.