William Dunstan was born on 8 March 1895 at Ballarat, Victoria to William John and Henrietta (nee Mitchell) Dunstan. He was educated at Golden Point State School and was reportedly an excellent pupil. After leaving school at the age of 15, he worked as a delivery boy and clerk with Snow's Drapery store in Ballarat, studying at home in the evenings. Dunstan served three years in senior cadets under the compulsory training scheme where he reached the cadet rank of captain. This was followed by a transfer to the 70th Infantry (Ballarat Regiment) as lieutenant in July 1914. Following the outbreak of the First World War he enlisted in Melbourne on 2 June 1915 and was posted as a private (no. 2130) with the 6th reinforcements to 7 Battalion (7Bn). He embarked with the reinforcements on HMAT A62 Wandilla on 17 June, bound for Egypt and joined his battalion at Gallipoli on 5 August 1915. On the same day he was made acting corporal.

He was awarded a Victoria Cross for his actions at the Battle of Lone Pine on 9 August. Later that same day Dunstan was evacuated from Gallipoli for treatment of head and eye injuries he had suffered in the battle. His eyesight had not fully recovered when, in early September, he was invalided back to Australia on HMAT A38 Ulysses. He was medically discharged on 1 February 1916 and Mentioned in Dispatches by General Sir Ian Hamilton the following month.

Soon after returning, his old employer presented him with 50 pounds. The residents of Ballarat offered to add to the sum but he declined saying that there were hundreds of other Australians less lucky than him that had earned equal praise. Despite his injuries, Dunstan joined the Citizen Forces as a lieutenant and was actively engaged in the pro-conscription debate, attending various rallies in its support. In one interview later in the war he avowed that '[i]f I had a thousand votes I would give every one of them in favour of conscription.'

Dunstan married Marjorie Carnell on 10 November 1918. The couple had three children, a daughter and two sons. Both sons, William and Keith, served in the Second World War.

Though he was celebrated for his actions at Lone Pine he avoided talking of his time as a soldier. His war experiences were never discussed in the family home. His VC and medals spent years in a box under the stairs, rarely seeing the light of day. On the few occasions that Marjorie took them out to show the children, it was done without William's knowledge. He was haunted by his time at Gallipoli and the injuries he sustained continued to take a toll on him. He periodically suffered severe headaches from shrapnel lodged in his head; a condition that stayed with him for the rest of his life.

Despite this he had a successful business career. Soon after the war he became private secretary to Sir Nicholas Lockyer, the acting Secretary of the Repatriation Department. In 1921 he joined the staff of the Herald and Weekly Times as an accountant, rising to the position of general manager in 1934 until his retirement in 1953. During this time his career expanded to include seats on the boards of various media and textile companies. With the outbreak of the Second World War, Dunstan contacted General Blamey to secure a command, only to be rejected on medical grounds. As well as his business interests he took a keen interest in horse racing. William Dunstan died on 2 March 1957 after suffering a heart attack while he was returning from the Caulfield racecourse.