After his short-lived band Arnold Corns folded in February, Bowie returned to the studio in May 1971 to record his next album. He brought back Ronson and Woodmansey and hired Trevor Bolder, a former hairdresser and piano tuner, as a bass player to replace Visconti. After Bolder was hired, the trio grouped at Haddon Hall to rehearse some of Bowie's new material, such as the song "Andy Warhol". Bowie and his new backing trio, soon to be named the Spiders from Mars, played for the first time on 3 June on BBC DJ John Peel's radio programme In Concert. The set included debut performances of several songs Bowie had recently written such as "Queen Bitch", "Bombers", "Song for Bob Dylan" and "Andy Warhol". The title Hunky Dory was also announced at this session.
Bowie and the future Spiders officially started work on the new album at Trident Studios in London on 8 June 1971. Ken Scott, who had engineered Bowie's two previous records, was hired to co-produce alongside him. Scott accepted the position as a way to gain experience, although at the time he didn't believe Bowie would become a huge star. His debut as a producer, Scott borrowed some of the acoustic sounds of George Harrison's All Things Must Pass (1970), an album he engineered. Scott retained the role of co-producer for Bowie's next three records: Ziggy Stardust, Aladdin Sane and Pin Ups. Bowie played demos for Scott and the two picked which ones would be recorded for the album. On 8 June, the band recorded "Song for Bob Dylan", although according to Nicholas Pegg this version was scrapped and the released version was not recorded until 23 June. Scott later recalled that recording went very quickly: "Almost everything was done in one take." Discussing Bowie's vocals, Scott stated: "He was unique. [He is] the only singer I ever worked with where virtually every take was a master." Bolder described recording with Bowie for the first time as a "nerve-wracking experience": "When that red light came on in the studio it was, God, in at the deep end or what!" As a co-producer Bowie took an active interest in the album's sound and arrangements, an about-face from his generally hands-off attitude during the Man Who Sold the World sessions.
Rick Wakeman, noted session musician and member of the Strawbs, plays piano on the album; he previously played Mellotron on David Bowie (1969). In 1995 he recalled that he met with Bowie in late June 1971 at Haddon Hall, where he heard demos of "Changes" and "Life on Mars?" in "their raw brilliance ... the finest selection of songs I have ever heard in one sitting in my entire life ... I couldn't wait to get into the studio and record them." According to Wakeman, the first few sessions started poorly as the band had not learned the songs. He recalled that Bowie had to halt the sessions, telling the musicians off and to come back when they knew the music. When they returned after a week, Wakeman thought "the band were hot! They were so good, and the tracks just flowed through." This story has been contested by other band members, including Bolder, who told the biographer Kevin Cann: "[That's] rubbish. David would never have told the band off in the studio. Especially as Mick and Woody had already left him once, and everyone was now getting on. The band would not have survived that – it definitely didn't happen." Scott contended: "I definitely don't remember that, and it's not something I would forget. I would definitely dispute that one."
On 9 July, with Wakeman in the line-up, Bowie and the band recorded two takes of "Bombers" and "It Ain't Easy", the latter featuring backing vocals by Dana Gillespie. Five days later, the group recorded four takes of "Quicksand", the last of which appears on the finished album. On 18 July, the group spent the day rehearsing and mixing. Further mixing sessions were carried out between 21 and 26 July to compile a promotional album for Gem Productions. By this point, the songs "Oh! You Pretty Things", "Eight Line …