Allan Johnston's team have been rewarded for their thumping 4-1 over Arbroath on Saturday with a trip to Station Park on either Tuesday 18th or Wednesday 19th August.
Dick Campbell's Loons were unbeaten in four league matches with the Pars last term, and booked their place in the second round with a 1-0 win over Montrose.
The teams met at the same stage of the Challenge Cup in the 1995/96 season, when Dunfermline won 2-1 at East End Park on route to the semi finals, where they were beaten by Dundee United.
But in 2012, Forfar defeated the Pars 3-2 in the first round at Station Park.
The full draw is as follows.
North Section: Forfar Athletic v Dunfermline Athletic Falkirk v Peterhead Alloa Athletic v Elgin City Stenhousemuir v Raith Rovers.
South Section: Annan Athletic v St Mirren Ayr United v Rangers Queen of the South v Livingston Queen's Park v Dumbarton.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here