The son of Robert Dundas, 2nd Viscount Melville and his wife Anne (née Huck-Saunders), Dundas was educated at Harrow School and joined the Royal Navy in 1817. After initial training at the Royal Navy College at Portsmouth he joined the frigate HMS "Ganymede" in the Mediterranean Fleet. Promoted to lieutenant on 16 June 1821 and to commander on 23 June 1823, he was given command of the sloop HMS "Sparrowhawk" on the North America and West Indies Station in June 1823.