After the war, McNamara was stationed in Japan with No. 82 Squadron, as part of the British Commonwealth Occupation Force (BCOF). He was promoted to temporary flight lieutenant on 1 May 1946, and received a short-service commission in the Permanent Air Force on 23 September 1948, with the rank of flight lieutenant. In 1949 he was posted to Headquarters North-Eastern Area for air traffic control work. He married Dorothy Miller on 27 May 1950; the couple had two daughters. On 1 September 1950, McNamara was granted a permanent commission in the RAAF. From 1951 to 1953, he served as an instructor at Central Flying School in East Sale, Victoria, gaining promotion to squadron leader on 1 July 1952. He then saw operational service in the Korean War as the Executive Officer of No. 77 Squadron, flying Gloster Meteors. Initially employed in the conflict as a fighter unit, by this time No. 77 Squadron's role was primarily ground attack, using the Meteors' cannon augmented by newly fitted rocket armament. McNamara briefly took charge of the unit in November–December 1953 when there was a hiatus between commanding officers rotating out and rotating in.