Dundalk will face a trip to Albania or Azerbaijan in the second qualifying round of the Champions League, should they defeat Riga FC.
Following yesterday's first round qualifying draw, the draw for the second round took place today at UEFA's headquarters in Switzerland.
Should Dundalk defeat the Latvian champions in the first round, either Partizani of Albania or Qarabağ from Azerbaijan will provide the opposition.
Qarabağ have a strong European record in recent seasons, qualifying for the group stages of the Champions League in 2017-8, and for the group stages of the Europa League in every other season since 2014-5.
Dundalk or Riga would have home advantage in the first leg on July 23 or 24, before the return leg on July 30/31.
Should Dundalk lose, they would have a tough draw in their Europa League second qualifying round, playing the losers of BATE Borisov (Belarus) and Piast Gliwice (Poland), with the first leg away from home on July 25. The return leg is fixed for August 1.
Scottish champions Celtic, should they overcome Sarajevo in their Champions League qualifier, will face either Nõmme Kalju (Estonia) or Shkëndija (North Macedonia), with the first leg at home.
Neil Lennon is likely to turn to winger Jonny Hayes for advice if his side ends up facing Shkendija in the next round.
The Irishman was part of the Aberdeen side which claimed a 1-1 Europa League draw in Tetovo in 2015 as they edged the Macedonians out on away goals.
UEFA have handed Lennon's side the added safety net of a bye to the third qualifying round of the Europa League should they fail to get past Sarajevo.
Normally teams beaten in the opening Champions League qualifier would enter the lesser competition at the second round, but the loser of Celtic's clash with the Bosnians will be spared action until the next round due to an odd number of teams entering the Europa League's champions' path.
Should Northern Ireland champions Linfield shock Rosenborg, they would play the winners of BATE Borisov v Piast Gliwice in the Champions League qualifiers. If they lose, they will face the losers of HJK Helsinki (Finland) and HB Tórshavn (Faroe Islands) in the Europa League qualifiers.
The remainder of the Europa League second qualifying round draw will take place later this afternoon.
The Champions League second-round qualifying draw in full:
Astana (KAZ)/CFR Cluj (ROU) v Maccabi Tel-Aviv (ISR)
BATE Borisov (BLR)/Piast Gliwice (POL) v Linfield (NIR)/Rosenborg (NOR)
The New Saints (WAL)/Winners of the preliminary round v København (DEN)
Ferencváros (HUN)/Ludogorets (BUL) v F91 Dudelange (LUX)/Valletta (MLT)
Dundalk (IRL)/Riga (LVA) v Partizani (ALB)/Qarabağ (AZE)
Sheriff Tiraspol (MDA)/Saburtalo (GEO) v GNK Dinamo (CRO)
Celtic (SCO)/Sarajevo (BIH) v Nõmme Kalju (EST)/Shkëndija (MKD)
Sūduva (LTU)/Crvena zvezda (SRB) v HJK Helsinki (FIN)/HB Tórshavn (FRO)
Slovan Bratislava (SVK)/Sutjeska (MNE) v APOEL (CYP)
Valur Reykjavík (ISL)/Maribor (SVN) v Ararat-Armenia (ARM)/AIK (SWE)
Viktoria Plzeň (CZE) v Olympiacos (GRE)
PSV Eindhoven (NED) v Basel (SUI)
The Europa League second-round qualifying draw (for teams knocked out of the Champions League):
SP Tre Penne (SMR)/FC Santa Coloma (AND) v Sūduva (LTU)/Crvena zvezda (SRB)
BATE Borisov (BLR)/Piast Gliwice (POL) v Dundalk (IRL)/Riga FC (LVA)
Partizani (ALB)/Qarabağ (AZE) v Sheriff Tiraspol (MDA)/Saburtalo (GEO)
Ararat-Armenia (ARM)/AIK (SWE) v Feronikeli (KOS)/Lincoln Red Imps (GIB)
Valur Reykjavík (ISL)/Maribor (SVN) v Ferencváros (HUN)/Ludogorets (BUL)
Valur Reykjavík (ISL)/Maribor (SVN) v The New Saints (WAL)/Winners of the preliminary round
Losing finalist, preliminary round v Astana (KAZ)/CFR Cluj (ROU)
HJK Helsinki (FIN)/HB Tórshavn (FRO) v Linfield (NIR)/Rosenborg (NOR)
Nõmme Kalju (EST)/Shkëndija (MKD) v F91 Dudelange (LUX)/Valletta (MLT)