Thornhill () is a town in the Mid Nithsdale area of Dumfries and Galloway, Scotland, south of Sanquhar and north of Dumfries on the main A76 road. Thornhill sits in the Nithsdale valley with the Carsphairn and Scaur range to the west and the Lowther hills to the east. It was initially a small village, planned and built in 1717 on the Queensberry Estate on the road linking Dumfries to Glasgow. The Earl of Queensberry initially named the village 'New Dalgarnock' however the name did not achieve popular approval.