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.
Wahab Riaz, Faheem Ashraf included in 20-man shortlist for England Tests
The flair, the calmness and the promises: Pakistan's rhetoric in the lead up to first Test
Sohail Khan bags five wickets as Pakistan's leading batsmen flounder
'Plans underway to stage remaining PSL matches this year' - PCB
Pakistan grapple with selection predicament as fired up England eye strong start
Team Green put on improved batting display after Naseem Shah shines again
Broad takes 500 Test wickets, Woakes bags five as England reclaim Wisden Trophy
'Disappointed over England tour snub given my experience of county cricket' – Junaid Khan
Haris Rauf set to join Pakistan squad in England after returning two negative tests
Mohammad Amir departs for England tour after testing negative twice for Covid-19