Dol Guldur (“Hill of Sorcery” in Sindarin), also called “the dungeons of the Necromancer”, was a stronghold of Sauron located in the south of Mirkwood.
Dol Guldur was originally known as Amon Lanc (“Bald Hill”) in Greenwood the Great. It had been the capital of Oropher's Silvan Elves, who had departed north to the Dark Mountains (later known as the Mountains of Mirkwood).
Somewhere after T.A. 1000, an evil presence took over Amon Lanc. It was in 1050 that a shadow fell upon Greenwood and it began to be called Mirkwood). The hostile entity was known as “the Necromancer" by the peoples, but it was none other than Sauron who regained his powers after his defeat in the War of the Last Alliance. Thranduil son of Oropher led his people over the Forest River, where they remained.
The Council of the Wise long feared the Necromancer might indeed be Sauron, and in 2063 Gandalf went to Dol Guldur, and the “Necromancer”, not yet powerful, fled to the East. After four centuries in 2460 the “Necromancer” returned there, just as the One Ring was found by Sméagol the Stoor.
A dark shadow and cloud flowed from Dol Guldur. In T.A. 2510 when Eorl the Young was leading his riders to the Battle of the Field of Celebrant he steered his force westward to avoid this phenomenon. The riders entered a golden mist that came from Lórien to the west that contended with the darkness coming from Mirkwood.
In 2845 Thráin II, King of Durin’s folk-in-exile and holder of the last of the Seven Rings of the Dwarves, was imprisoned in Dol Guldur’s dungeons. In 2850 Gandalf again entered Dol Guldur, found the dying Thráin, and was entrusted with the map and key to give to Thorin, although Thráin could not tell him his own or his son’s name before he died. Gandalf confirmed that the Necromancer, the master of Dol Guldur at that time, was Sauron.
Gandalf returned to the White Council and urged an attack on Dol Guldur, but was overruled by Saruman, who had begun searching for the One Ring in the area by then. In T.A. 2941 Saruman finally agreed to an attack, which occurred at the same time as the Quest of Erebor. This was carefully planned by Gandalf, so that Sauron and Smaug could not assist each other, as otherwise they could easily have done. During the attack, Sauron fled to Mordor, his plans now ready.
In 2951 Dol Guldur was reoccupied by Khamûl, the second chief, and two other Nazgûl.
In the following decades Dol Guldur must have rebuilt some of its power until the War of the Ring, during which the forces of Dol Guldur made three assaults upon Lórien, causing grievous damage to the outlying woodlands. However each time they were driven back by the power of Nenya which only Sauron himself could have overcome.
Dol Guldur was finally destroyed and cleansed by the Elves of Lórien, led by Galadriel, after Sauron’s fall.
Other versions of the Legendarium
The original name of Dol Guldur was Dol Dúgol, and on Tolkien's first map for The Lord of the Rings the hill was located much farther east than its later location (in square M-15 of Map II). Christopher Tolkien explained that Map II had faint traces of green which suggested that Mirkwood originally extended farther to the east too. The name Dol Dúgol was stricken out and the hill was moved to its later location on this map, but its name became Dol Dúghul before finally changing to Dol Guldur.
Portrayal in adaptations
2012: The Hobbit: An Unexpected Journey:
Dol Guldur is depicted as a ruined and abandoned fortress of unknown origin. It features statues of the Nazgûl. Radagast, not Gandalf, enters Dol Guldur. He is attacked by a spirit (possibly the Witch-king), obtains a Morgul-blade, and finds that Dol Guldur is occupied by a Necromancer. He then travels to Gandalf to tell him the news and gives him the sword as proof.