People fished here long before there was a town: traps dug up while the Convention Centre was being built on the quays are about 6,000 years old. The name comes from dubh linn, the dark pool where the peaty River Poddle met the Liffey. That pool was filled in during the early 1700s, and its site is now the Castle Garden beside the Chester Beatty Library. The Irish name, Baile Átha Cliath, means town of the hurdled ford.
Vikings built a fortified base by the pool in 841 and grew it into a trading town, and part of that trade was in slaves seized in Wales and England. Brian Boru beat the Vikings and their Leinster allies at Clontarf in 1014, but he was killed in the battle. Dublinia, next to Christ Church, has an exhibition on life in the Viking and medieval town. The cathedral itself replaced a Viking wooden church with stone in the 1180s, which makes it the oldest building in the city.
The Normans came in 1169, invited by Diarmait Mac Murchada, an exiled King of Leinster, who brought in Strongbow to take Dublin for him. Henry II of England followed in 1171 and made himself Lord of Ireland, and in 1204 King John ordered Dublin Castle built. Through the Middle Ages the town was the heart of the Pale, a thin strip of English settlement on the east coast, small and walled, and always under threat from the Irish clans outside. The Castle stayed the seat of British rule, and you can still go down into its medieval basements.
The Tudors set out to make Dublin Protestant. Elizabeth I founded Trinity College in 1592 for Protestants only, and both medieval cathedrals were handed to the Protestant church, leaving the Catholic majority, whose worship was banned, with none. That's why the Catholic cathedral, St Mary's on Marlborough Place, is still a pro-cathedral: a stand-in, built in 1825 once the laws eased, that has never been replaced.
The 18th century built the Dublin most visitors picture. For a short time it was the second city of the British Empire, with more than 130,000 people, and from 1757 the Wide Streets Commission laid out its streets and bridges. Red-brick terraces went up around Merrion Square, and when the Duke of Leinster built his mansion on the unfashionable southside in 1745, power and money followed him across the river. Ireland had its own parliament then, in the building facing Trinity that is now the Bank of Ireland.
After the union with Britain in 1801, power and money moved to London. Grand northside houses became tenements: 14 Henrietta Street, built in the 1740s for a viscount, later housed 100 people, and a guided tour tells their story. The Famine of 1845 to 1849 killed a million people and drove another million abroad, and the gaunt figures of the Famine Memorial on Custom House Quay walk toward the ships. In 1913 the Lockout set James Larkin's union against employers led by tram owner William Martin Murphy, with 25,000 workers out within a month. After six months of hunger, most gave up and went back.
In April 1916 about 1,250 rebels took the General Post Office and other strongpoints, and Patrick Pearse read a proclamation of an Irish Republic outside its door. British guns, including a gunboat sent up the Liffey, put the rising down, and around 450 people died, half of them civilians. Most Dubliners were hostile at first. The executions of the leaders turned them, Sinn Féin swept the 1918 election, and after the War of Independence, Dublin became the Free State's capital in 1922. The GPO's shell survived the fighting; inside, a museum tells the story.
Independent Dublin was hard on its old buildings. Office developers tore down large parts of Georgian Dublin in the mid-20th century, and the IRA blew up Nelson's Pillar on O'Connell Street in 1966. Preservation orders finally came for most Georgian neighbourhoods. Then a building boom filled derelict sites with offices and flats, and Google and Deloitte now loom over the city. Few new homes have been built, so rents have soared.