The tie will take place in the week commencing August 11, following Boro’s first Championship game of the season at home to Swansea City.
A home tie will no doubt delight new boss Rob Edwards.
Doncaster are preparing for life back in League One after winning promotion as champions of League Two last season.
RECOMMENDED READING:
The tie will be the first time the two sides have met in a competitive game since 2014, when they played out a 0-0 draw at Doncaster. Boro won 4-0 the last time the sides met at the Riverside.
Doncaster are currently managed by former Hull City boss Grant McCann.
Boro thumped Leeds United in the Carabao Cup first round last season before being on the receiving end of a heavy defeat at home to Stoke in the following round.
Michael Carrick’s side reached the semi-finals two seasons ago.