Sir David Barnett Dundas, 2nd Baronet of Beechwood FRSE, QC (28 August 1803 – 30 March 1877) was a Scottish advocate, Liberal politician and agricultural improver.
He was the son of Robert Dundas of Beechwood, 1st Baronet Dundas (1761–1835) and Matilda Cockburn (daughter of Archibald Cockburn. He was born at the family mansion of Beechwood House near Corstorphine in western Edinburgh on 28 August 1803. In 1824 he acquired Henry Dundas's estate of Dunira in Perthshire. On his father's death in 1835 David became the 2nd Baronet.
Dundas was educated at Westminster School and at Christ Church, Oxford. He was called to the Bar at the Inner Temple in 1824, and appointed Queen's Counsel in February 1840.
He was elected to represent Sutherland in Parliament as a Liberal in March 1840. In July 1846 he was appointed Solicitor General for England and Wales. At the time, it was the normal practice that accepting ministerial office caused a by-election; he was re-elected on 28 July. In February 1846 he was knighted, a traditional perquisite of the office, but he resigned the position in March 1848 due to ill-health and returned to the backbenches. In May 1849 he was appointed Judge Advocate General, again re-elected in a by-election on 5 June, and made a member of the Privy Council on 29 June.