Born Robert Dundas, he was the eldest son of Philip Dundas (c.1763–1807, the fourth son of Robert Dundas of Arniston, the younger), and Margaret (daughter of John Wedderburn of Ballendean (1729–1803) and sister of Sir David Wedderburn, 7th Baronet (1775–1858)).