Dunfermline is a town and former Royal Burgh in Fife, Scotland, on high ground 3 miles (4.8 km) from the northern shore of the Firth of Forth. According to a 2008 estimate, Dunfermline has a population of 46,430, making it the second-biggest settlement in Fife. Part of the town's name comes from the Gaelic word "dun" meaning a fortified hill. The other parts, "ferm" and "lyn", are unclear, although "ferm" may have been an alternative name for the tower burn and "lyn", a pool or cascade. Together, this may suggest the site of a fortification between the Ferm Burn and the Lyne Burn to the south.
The earliest known settlement in the Dunfermline area was during the Neolithic period. However, it was not until the Bronze Age, that the area grew in importance. Remains of Cist Burials are known to have existed at both Crossford and Masterton. The first written record of the town was made in the 11th century, when Malcolm III, King of Scotland (1068–1093) married his second wife, Margaret at the church in Dunfermline between 1068 and 1070. Dunfermline became a capital of Scotland, when Malcolm III moved his royal court here from Perthshire. This city status was held until the death of James I at Perth in 1437. His wife, Margaret was responsible for bringing Roman Catholicism into Scotland and establishing a new church dedicated to the Holy Trinity which evolved into Dunfermline Abbey under her son, David I in 1128. The graveyard of this Abbey eventually became the burial place to many of Scotland's Kings and Queens, taking over this role from Iona.© This article about tourism in Dunfermline is provided by a external resource