After the outbreak of World War I, the government taking wartime control of the railway system, and in 1917 Dunnell's services were lent to the government. He was appointed as an additional assistant secretary to the
Admiralty. He served as secretary to the British Naval Mission led by
Sir Eric Geddes, who had been Dunnell's colleague at the North Eastern Railway, that travelled to the United States in October 1918. The purpose of the mission was to consult with the US government regarding measures to be adopted to counter the heavy losses of Allied shipping by
German submarines. At the end of the war, Dunnell was appointed secretary of the
demobilisation section of the
War Cabinet, again working under Geddes. After the establishment of the
Ministry of Transport in September 1919, the directors of the North Eastern Railway consented to Dunnell's temporary transfer to the ministry for two years during "the period of control". He was appointed first secretary and solicitor to the newly-formed ministry, under Geddes as the first Minister of Transport. In December 1921, it was announced that he would be created a
baronet for his services to the Ministry of Transport during the period of post-war work, to take effect from 11 January 1922. ==Post-war==