"Dick in a Box" is a song by the American comedy group The Lonely Island featuring American singer Justin Timberlake. The artists wrote the song with Katreese Barnes and Asa Taccone, who both produced it with Jorma Taccone. Saturday Night Live (SNL) creator and producer Lorne Michaels asked Samberg to write a musical sketch for the 2006 Christmas episode with Timberlake, who was returning as both host and musical guest. Samberg developed the concept with other members of the group before working with Timberlake on December 14. They recorded the track around midnight and spent the next day and a half filming the corresponding music video.