Younus (148) fell to the second new ball, having added 250 for the third wicket with Azhar (127 not out) as Pakistan laid the foundation for an imposing first innings total.
Captain Misbah-ul-Haq was unbeaten on nine at stumps.
Bangladesh captain Mushfiqur Rahim won the toss and opted to field but the hosts suffered an early jolt as paceman Shahadat Hossain limped off after the second delivery of the match with an injury.
Left with a depleted attack, Bangladesh still managed to send back openers Mohammad Hafeez (eight) and Sami Aslam (19) early to reduce Pakistan to 58 for two but let the visitors off the hook by overstepping on crucial deliveries.
Azhar was caught at slip on 18 but was saved when replays showed bowler Mohammad Shahid's front foot had not landed behind the crease.
Younus also got a reprieve on 78 when he was caught at short cover but part-time medium paceman Soumya Sarkar was found to have overstepped.
The 37-year-old Younus was the more fluent of the pair, putting the sweep shot to good use against the spinners and was the first to reach triple figures, his 29th in tests, with a square drive for two off Sarkar.
Shahid finally dismissed him when Younus, who hit 11 fours and three sixes in his knock, sliced a cut shot straight to the gully fielder.
Pakistan's 50-over captain Azhar lofted left-arm spinner Taijul Islam for a four to bring up his eighth test hundred.
Mushfiqur used nine bowlers in total to try and break the third-wicket stand between Younus and Azhar.
Bangladesh blanked Pakistan 3-0 in the ODI series and also won the lone Twenty20 match before drawing the first test at Khulna, despite conceding a huge first innings deficit.

Latest News from Sports News Desk