Before 1922 Buynaksk was known as Temir-Khan-Shurá (Темир-Хан-Шура), that is, the lake or cliff of Tamerlane who is said to have camped here in 1396 after defeating Tokhtamysh during the Tokhtamysh-Timur war. It first appears in Russian annals in the 1590s when Muscovite ambassadors passed nearby on their way to Georgia. It remained a small town ruled by a Bek. In 1830 the Russians destroyed it when it sided with Kazi Mulla. In 1832 a Russian force under Klugenau camped here during Rosen's raid on Gimry. In 1834 Klugenau built a fort on the rock above the lake and it soon became the headquarters of the Apsheron Regiment and the most important Russian fort in the interior of Degestan during the Murid War. In 1849 Hadji Murad led a daring raid into the town. The place was unhealthy and Argutinsky drained the lake in 1858 to prevent the spread of disease. It was granted town status in 1866. In 1920, it was the center of the ephemeral Mountainous Republic of the Northern Caucasus. On November 13, 1920, the government of the Russian SFSR declared Dagestan's autonomy during the congress of the Dagestani people, which took place in Temir-Khan-Shura. In 1922, the town was renamed Buynaksk in honor of a revolutionary Ullubiy Buynaksky. In May 1970, Buynaksk was badly damaged by an earthquake.
On August 13, 2009, Buynaksk was the site of two attacks associated with the growing violence throughout Dagestan and neighboring Chechnya. About ten men first opened fire with automatic weapons on a police post, killing four officers. The gunmen then entered a nearby sauna complex and killed seven female employees.
Three soldiers were killed, and thirty-two were wounded, in a suicide car-bombing at a military base in the city on September 5, 2010. The driver of a Zhiguli car smashed through a gate at the base and headed for an area where soldiers were quartered in tents. Soldiers opened fire on the car before it reached the center of the base. The driver then rammed the car into a military truck, where it exploded. After the blast, a roadside bomb hit a car taking investigators to the scene, but no injuries were reported in the second explosion. However, attackers claimed killing 56 Russian soldiers by the bombing.
Within the framework of administrative divisions, Buynaksk serves as the administrative center of Buynaksky District, even though it is not a part of it. As an administrative division, it is incorporated separately as the Town of Buynaksk—an administrative unit with the status equal to that of the districts. As a municipal division, the Town of Buynaksk is incorporated as Buynaksk Urban Okrug.