Dun is a generic term for an ancient or medieval fort. It is mainly used in the British Isles to describe a kind of hillfort and also a kind of Atlantic roundhouse. The term comes from Irish dún or Scottish Gaelic dùn (meaning "fort"), and is cognate with Old Welsh din (whence Welsh dinas "city") comes.
In some areas duns were built on any suitable crag or hillock, particularly south of the Firth of Clyde and the Firth of Forth. There are many duns on the west coast of Ireland and they feature in Irish mythology. For example, the tale of the Táin Bó Flidhais features Dún Chiortáin and Dún Chaocháin.
Duns seem to have arrived with the Celts in about the 7th century BC. Early duns had near vertical ramparts made of stone and timber. Vitrified forts are the remains of duns that have been set on fire and where stones have been partly melted. Use of duns continued in some parts into the Middle Ages.
Duns are similar to brochs, but are smaller and probably would not have been capable of supporting a very tall structure. Good examples of this kind of dun can be found in the Outer Hebrides of Scotland, on artificial islands in small lakes.
The word in its original sense appears in many place names, and can include fortifications of all sizes and kinds, for example Cumbric Din Eidyn was renamed as Scottish Gaelic Dùn Èideann, which is now Edinburgh Castle; Dún na nGall in Ireland (Irish: "fort of the foreigners") renamed Donegal during the Plantation of Ulster, and the broch Dùn Teilbh, now known as Dun Telve, in Glenelg, Highland.