In October 1899, MacDonald received the temporary rank of brigadier general and was seconded to command the Sirhind district in the Punjab with headquarters at Umballa. Following the outbreak of war in South Africa the same month, he was in December ordered there to command the Highland Brigade, part of the army of Lord Roberts. He arrived in Cape Town on 18 January 1900 by the transport Dwarka, and six days later assumed command of the Highland Brigade stationed at Modder River, with the local rank of major general. While in South Africa he prepared the way for Lord Roberts's march to the relief of Kimberley by seizing Koodoesberg (5–8 February 1900), and by this demonstration the attention of the Boers was distracted from the main advance. Later the same month he took part in the Battle of Paardeberg (16–27 February 1900), where he was wounded by a gunshot in the foot in an attack on a Boer laager. He took part in later operations in Bloemfontein and Pretoria. In April 1901 he was knighted as a Knight Commander of the Order of the Bath (KCB) for his services (dated to November 1900).