Electing to bat first in the dead rubber match, Dhawan smashed his sixth Test hundred, including 17 boundaries, while KL Rahul well supported him with his 85-run knock as the duo went on to share highest opening partnership against the islanders.
KL Rahul also surpassed Rahul Dravid's record to join Sir Everton Weekes, Andy Flower, Shivnarine Chanderpaul, Kumar Sangakkara and Chris Rogers in scoring seven consecutive half-centuries in Tests.
He reached his fifty off 67 deliveries to join an elite list of cricketers to hit most consecutive half-centuries.
Meanwhile, Indian skipper Virat Kohli also contributed with 42 runs.
However, Sri Lanka fought back well in the second and third sessions to reduce the Indian side to six wickets at the end of the day's play.
Malinda Pushpakumara wrecked havoc as he sent three Indian batsmen back to the pavilion, with Ajinkya Rahane being his last victim.
Lakshan Sandakan bagged two wickets while Vishwa Fernando also chipped in with a wicket.
At stumps, Wriddhiman Saha (13) and Hardik Pandya (one) were batting at the crease.
India, who have already taken a 2-0 lead in the series following their massive win by an innings and 53 runs, are aiming to complete three-match Test series whitewash. (ANI)