Tottenham will play Romania's Botosani or Macedonian club Shkendija in the third round of Europa League qualifying if they defeat Lokomotiv Plovdiv.
Scottish champions Celtic enter the tournament in this round following their early exit from Champions League qualifying and will face Latvian side Riga or San Marino's Tre Fiori.
Aberdeen will play Sporting Lisbon if they beat Viking of Norway in the previous round.
Matches will be played on 24 September.
The draw for the third round of qualifying was made just a day after the second-round draw.
FA Cup winners Arsenal and fifth-placed Premier League side Leicester City will enter at the group stage.
Third qualifying round ties involving British & Irish sides:
LINFIELD or Floriana v Flora Tallinn or KR Reykjavik
Laç or Hapoel Beer-Sheva v COLERAINE or MOTHERWELL
Sheriff v Inter Escaldes or DUNDALK
Riga or Tre Fiori v CELTIC
Ki v CONNAH'S QUAY NOMADS or Dinamo Tbilisi
Sporting Lisbon v Viking or ABERDEEN
SHAMROCK ROVERS or AC Milan v Bodo/Glimt or Zalgiris Vilnius
Botosani or Shkendija v Lokomotiv Plovdiv or TOTTENHAM
Progres Niederkorn or Willem II v Lincoln Red Imps or RANGERS
BALA TOWN or Standard Liege v Vojvodina
CSKA Sofia or BATE Borisov v B36 Torshavn or THE NEW SAINTS
- Reading and Leeds Festival: Relive sets from Arctic Monkeys, Billie Eilish, The 1975 and more
- Sunny Day Mix: Selected tracks to bring peace to your day