After setting an opening partnership record and declaring their first innings on 583 for seven, South Africa also posted a wicketkeeping record on the second day of the second Test against Bangladesh on Saturday.
With two catches behind, wicketkeeper Mark Boucher overtook Adam Gilchrist and took his tally for Test wicketkeeping catches to 401, helping South Africa restrict Bangladesh to 60 for three at the close.
Earlier Skipper Graeme Smith and Neil McKenzie set a world record of 415 for an opening stand.
Pace bowler Dale Steyn took all three Bangladesh wickets for 14 runs to reach 100 Test wickets in just 20 Tests.
At the start of Bangladesh's second innings Tamim Iqbal (14) was caught at slip by AB de Villiers off a ninth-over delivery from Steyn.
Boucher caught opener Zunaed Siddique (18) and captain Mohammad Ashraful for a duck off two consecutive deliveries from Steyn, to set his record.
RECORD SURPASSED
Smith was on 231 and McKenzie on 170 in the morning when they surpassed the record of 413 for the opening wicket set by Indian pairing Vinoo Mankad and Pankaj Roy against New Zealand in 1956.
South Africa were 570 for five at tea and lost Boucher (21) and Robin Peterson (4) to left-arm spinner Mohammad Rafique, who was playing his last international and removed them in consecutive overs to make his Test tally to 100 wickets, a record for his side.
Graeme Smith declared the innings just after Zunaed Siddique caught Peterson at slip off a Rafique delivery. Rafique also removed Boucher, caught at cover.
Shahadat Hossain finally dismissed McKenzie for 226, then trapped Hashim Amla for 38 and bowled Ashwell Prince for two in his two subsequent overs. Shakib Al Hasan then bowled AB de Villiers for one.
Razzak made the breakthrough in the first session of the day bowling Smith for 232 with South Africa plundering runs on a flat batting pitch to the frustration of the Bangladesh bowlers.
DOUBLE CENTURIES
It was only the second time a pair of openers had both notched double centuries in a Test.
The first pair to achieve the mark were Australia's William Lawry (210) and Robert Simpson (201) against West Indies in Barbados in 1965.
Smith faced 414 balls, smashing 33 boundaries and one six in his innings.
The opening pair's run spree put South Africa in a strong position to complete a series whitewash after a five-wicket win in the first Test.
Smith enjoyed a personal landmark becoming the latest South African to reach 5,000 Test runs, joining Jacques Kallis, Gary Kirsten and Herschelle Gibbs. He also becames the first South African to score four double hundreds, surpassing the record he had shared with Kirsten.
A satisfied South Africa coach Mickey Arthur praised all the batsmen for the feats they had achieved.
"I am very satisfied, obviously our middle order missed out today. but they played quite well in Dhaka. So all our batsmen have had a go."
"The one thing that strikes me most was the intensity with at which they batted. That's the key."
Steyn said his bowling plan worked well too. "We basically forced the batsmen to play shots that they shouldn't have played," he said.
"We are just planning to bowl them out cheaply and put them to bat again and win the match," he added.
(Writing by Nizam Ahmed, editing by Clare Lovell)