Kilmarnock will welcome Ayr United to Rugby Park. The Ayrshire derby was one of 11 ties drawn at Murrayfield before the second leg of Celtic's Champions League third qualifier against Legia Warsaw, with five Premiership sides entering the tournament at this stage.
St Mirren were handed a home draw against Dunfermline, Partick Thistle visit Greenock Morton while newly-promoted Hamilton welcome Alloa Athletic.
The winner of the first-round tie between Queen's Park and Rangers will host Inverness.
Holders Aberdeen do not enter until the third round, along with Celtic, Motherwell, Dundee United and St Johnstone.
Hibernian v Dumbarton
Morton v Partick Thistle
Falkirk v Cowdenbeath
Queen's Park or Rangers v Inverness Caledonian Thistle
Hamilton Academical v Alloa Athletic
Stranraer v Ross County
Dundee v Raith Rovers
Livingston v Queen of the South
Kilmarnock v Ayr United
Stenhousemuir v Heart of Midlothian
St Mirren v Dunfermline Athletic
Ties to be played August 26 and 27 apart from the game between Queen's Park or Rangers and Inverness as the first-round tie between Queen's Park and Rangers is scheduled for August 26.