The Dual Alliance (German: Zweibund, Hungarian: Kettős Szövetség) was a defensive alliance between Germany and Austria-Hungary, which was created by treaty on October 7, 1879, as part of Germany's Otto von Bismarck's system of alliances to prevent or limit war. The two powers promised each other support in case of attack by Russia. Also, each state promised benevolent neutrality to the other if one of them was attacked by another European power (generally taken to be France, even more so after the Franco-Russian Alliance of 1894). Bismarck saw the alliance as a way to prevent the isolation of the German Empire, which had just been founded a few years before, and to preserve peace, as Russia would not wage war against both empires.

Formation
When Austria-Hungary and Germany formed an alliance in 1879, it was one of the more surprising alliances of its time. Though both shared the German language and a similar culture, Austria-Hungary and Germany were often driven apart, most notably during the recent Austro-Prussian War. Additionally, the Habsburg rulers believed that the promotion of nationalism, which was favoured by Germany, would destroy their multinational empire. However, their common distrust of Russia brought both empires together for a common cause.
What were the primary motivations for the Dual Alliance?
The primary motivations for the alliance between Germany and Austria-Hungary were peacemaking and protection. The alliance ensured that both Germany and Austria-Hungary would be safe from attack by Russia. The alliance also promoted peace between the two countries and other European powers.