Dunbar is a former Royal Burgh and gave its name to an ecclesiastical and civil parish. The parish extends around 7½ miles east to west and is 3½ miles deep at greatest extent (12 by 5.5 kilometres) or 11¼ square miles (c.3000 hectares) and contains the villages of West Barns, Belhaven, East Barns (abandoned) and several hamlets and farms.
Its strategic position gave rise to a history full of incident and strife but Dunbar has become a quiet dormitory town popular with workers in nearby Edinburgh, who find it an affordable alternative to the capital itself. Until the 1960s the population of the town was little more than 3,500.
The name Dunbar has Brythonic roots and means something like ‘summit-fort’, which gives an idea about its beginning. To the north of the present High Street an area of open ground called Castle Park preserves almost exactly the hidden perimeter of an iron age promontory fort. The early settlement was a principal centre of the people known to the Romans as Votadini and it may have grown in importance when the great hillfort of Traprain Law was abandoned at the end of the 5th century AD. Dunbar was subsumed into Anglian Northumbria as that kingdom expanded in the 6th century and is believed to be synonymous with the Dynbaer of Eddius around 680AD, the first time that it appears in the written record. It was then a king's vill and prison to Bishop Wilfrid. As a royal holding of the kings of Northumbria, the economy centred on the collecting of food renders and the administration of the northern (now Scottish) portion of that kingdom. It was the base of a senior royal official, a reeve (later sheriff), and, perhaps, in the 7th century a dynasty of ealdormen or sub-kings who held northern Northumbria against Pictish encroachment.
Danish and Norse attacks on southern Northumbria caused its power to falter and the northern portion became equally open to annexation by Scotland. Dunbar was burnt by Cináed mac Ailpín in the 9th century. Scottish control was consolidated in the next century and when Lothian was ceded to Máel Coluim II after the battle of Carham in 1018, Dunbar was finally an acknowledged part of Scotland.
Throughout these turbulent centuries Dunbar’s status must have been preserved because it next features as part of a major land grant and settlement by Máel Coluim III in favour of the exiled earl Gospatric of Northumbria (to whom he may have been full cousin) during 1072. Malcolm needed to fill a power vacuum on his south-eastern flank; Gospatric required a base from which to plot the resumption of his Northumbrian holding. The grant included Dunbar and, it can be deduced, an extensive swath of East Lothian and Berwickshire or Merse (hence March). Gospatick founded the family of Dunbar, Earls of Dunbar and March until the 15th century.
The town became successively a baronial burgh and royal burgh (1370) and grew slowly under the shadow of the great Castle of the earls. Scotland and England contended often for possession of the castle and town. The former was 'impregnable' and withstood many sieges; the latter was burnt, frequently. The castle had been slighted (deliberately ruined) in 1568 but the town flourished as an agricultural centre and fishing port despite tempestuous times in the 17th and early 18th centuries. Major battles were fought nearby in 1296 and 1650. The second Battle of Dunbar (1650) was fought during the Wars of the Three Kingdoms between a Scottish Covenanter army and English Parliamentarians led by Oliver Cromwell. The Scots were routed, leading to the overthrow of the monarchy and the occupation of Scotland.
Dunbar gained a reputation as a seaside holiday and golfing resort in the 19th century, the 'bright and breezy burgh' famous for its 'bracing air'.
An archaeological excavation undertaken by Headland Archaeology  on a site previously occupied by the Captain's Cabin (a local landmark) within the area of Castle Park identified a sequence of archaeolgoical features reflecting around 2000 years of human activity. The earliest feature was a large ditch which may have formed part of the defences around a promontory fort previously identified during earlier excavations near the coast at Castle Park  . The scale of the ditches indicated an impressive monument. A radiocarbon date of between 50 BC and AD 70 was obtained from charcoal recovered from its infill.
Much later a rectangular building was built over the top of the infilled ditch. Large quantities of burnt grain were recovered indicating that the building was a grain store that had been destroyed by fire. It was established that this was part of the Anglian settlement that had also been identified during earlier excavations.
Between the 9th and 11th centuries AD the area was used as a cemetery  . 76 articulated skeletons and the disarticulated remains of a further 51 individuals were recovered. The articulated skeletons were all buried in the standard Christian fashion. A small number of the skeletons were in long cists but the majority were simple shroud burials.A dump of midden above the cemetery contained many elephant ivory off-cuts dating to the 18th or 19th centuries.
Due to its geographical location, Dunbar receives less rain and more hours of direct sunshine per year than anywhere else in Scotland (according to the Met Office). The town has begun to be referred to by locals as 'Sunny Dunny', after a local radio host popularised the term.
Agriculture remains important, but fishing has declined. Its main manufactures are cement at Lafarge Cement Oxwell Mains (the only integrated cement plant in Scotland) and the Scottish Ales of Belhaven Brewery. Another large local employer is Torness Nuclear Power Station. A large portion of the workforce now commute to Edinburgh or further afield.
Dunbar is noted as the birthplace of the explorer, naturalist and conservationist John Muir. The house in which Muir was born is located on the High Street, and has been converted into a museum. There is also a commemorative statue beside the town clock, and John Muir Country Park is located to the northwest of the town. The eastern section of the John Muir Way coastal path starts from the harbour.
Each year on the last full weekend in September, Dunbar holds a traditional music festival sponsored by various local companies.
Planning Permission and construction for over two years on the outskirts at the Spott Roundabout site (A1) has given the town an ASDA supermarket and petrol station (their first in East Lothian). The development is due to be accompied by a still unconfirmed fast food drive-thru restaurant, a tourist office and a hotel at a later date.http://www.eastlothiannews.co.uk/news/Asda-to-move-into-East.1425087.jp http://www.berwickshire-news.co.uk/news/New-ASDA-store-seeks-local.3452550.jp ASDA are proposing to help local businesses and charities in the town as part of their commitment. http://www.eastlothiannews.co.uk/news/Asda-pledge-to-Dunbar.3392513.jp.Although this will be guaranteed to boost the retail facilities and catchment area of Dunbar, attracting people from Berwick and Haddington to come, there is a fear it might bring congestion to the site and will lead to the decline of the present town centre shops especially the Co-op.http://www.eastlothiannews.co.uk/news/More-car-park-space-urged.992939.jp http://www.eastlothiannews.co.uk/news/Coop-fears-Asda-presence-in.1011910.jp
Dunbar is twinned with the following places:
Dunbar Grammer School is a state secondary school that serves as the main secondary school for Dunbar and the surrunding areas. The school has approx 730-750 pupils.As of 2004, Paul Raffaeli is the school's current headmaster, following Don Leddingham.
Subjects taught at Dunbar Grammar School include Mathematics,English,Biology,Chemistry,Physics,German,French,Craft Design and Technology,Graphic Communication,Technological Studies,Home Economics,Hospitality,Physical Education,Administration,Information Systems,Computing,Art,Modern Studies,History,Geography,Business Management,Music,Drama,Personal and Social Education,Enhanced Curriculum andLearning Support.
Many youth groups use the facilities of The Countess Youth and Community Centre. Youth Club runs Mondays, Tuesdays and Thursdays (term time) between 1830 to 2000 for primary 4 to 7 children and 2000 to 2200 for young people at Secondary School. The Youth Cafe is held on Wednesday and Saturday evenings. The centre is also used by a Playgroup, an AfterSchool Club and a line dancing club to name a few.