Catalyzes the ATP-driven ligation of two D-alanine molecules to form the D-alanyl-D-alanine dipeptide. This molecule is a key building block in peptidoglycan biosynthesis. ATP + 2 D-alanine = ADP + D-alanyl-D-alanine + H(+) + phosphate Binds 2 magnesium or manganese ions per subunit. Is inhibited by the antituberculous drug D-cycloserine (DCS), which is a structural analog of D-alanine (PubMed:20956591, PubMed:23286234). Is activated by K(+) (PubMed:23286234). kcat is 9.7 sec(-1) (at pH 7.3). Cell wall biogenesis; peptidoglycan biosynthesis. Homodimer. Follows an ordered ter-ter mechanism. ATP is the first substrate to bind and is necessary for subsequent binding of D-alanine or DCS. ADP is the final product to dissociate. Belongs to the D-alanine--D-alanine ligase family.