Rashid grabbed three of the remaining four wickets as Afghanistan took 17.2 overs on the fifth day to bowl out Bangladesh for 173.
The visitors -- playing only their third Test ever -- reduced Bangladesh to 136-6 before rain forced an early stump on the fourth day.
Debutant Zadran hit highest 87 off 208 balls for Afghanistan in the second innings while former skipper Afghan made 50 off 108 balls.
The major reason behind Nabi's decision to step away wasn’t stated but the decision might help him prolong his white-ball career
Rashid hit 51 off 61 balls to take Afghanistan to 342 in their first innings and then claimed 4-47 to leave Bangladesh struggling at 194 for eight.
Shah made 102 and put on a crucial 120-run fourth-wicket stand with Asghar Afghan, batting on 88, to counter the Bangladesh spin attack.
He becomes the youngest ever Test captain at 20 years and 350 days, overtaking Zimbabwe's Tatenda Taibu, who was eight days older.
The solitary Test match against Afghanistan will be Domingo's first assignment as the Bangladesh head coach.
Vivacious Asad sends positive vibes ahead of daunting Australia Tests
Dale Steyn, Rashid Khan, Hashim Amla and other big names join PSL 2020
Dean Jones appointed Karachi Kings head coach
Imran Nazir opens up about his life-threatening disease
Players shuffle among franchises before IPL 2020 auction
‘Focusing on taking every opportunity to play for England’ – Malan targets recall in longer formats
Duminy ruled out of MSL 2019 due to hamstring injury
Sharjeel placed in Gold category for PSL draft
Hafeez explains stance on Amir's comeback
Williamson deemed fit, Ferguson handed maiden Test call-up for England