Dunedin is the second-largest city in the South Island of New Zealand (after Christchurch), and the principal city of the Otago region. Its name comes from Dùn Èideann, the Scottish Gaelic name for Edinburgh, the capital of Scotland.
Archaeological evidence points to lengthy occupation of the area by Māori prior to the arrival of Europeans. The province and region of Otago takes its name from the Ngāi Tahu village of Otakou at the mouth of the harbour, which became a whaling station in the 1830s.
In 1848 a Scottish settlement was established by the Lay Association of the Free Church of Scotland and between 1855 and 1900 many thousands of Scots emigrated to the incorporated city. Dunedin's population and wealth boomed during the 1860s Central Otago Gold Rush, and for a brief period of time it became New Zealand's largest urban area.