Cain threw a complete game against the Nationals on June 8, 2011, striking out 11, allowing one run, and hitting an RBI double against Yunesky Maya in a 3–1 Giants victory. On June 25, he threw seven shutout innings (retiring 14 hitters in a row at one point) and earned the win in a 1–0 victory over the Cleveland Indians. On June 30 at Wrigley Field, Cain struck out the Chicago Cubs' Koyie Hill for his one-thousandth career strikeout, becoming the fifth San Francisco Giants pitcher to reach the milestone. Also, he again threw seven shutout innings but received a no-decision this time in the Giants' 13-inning, 5–2 loss to the Cubs. He was an All-Star for the second time in his career in 2011; however, he did not appear in the All-Star Game because he started the final regular season game prior to the All-Star contest. He had a 2.64 ERA in 14 starts after the All-Star break but earned just four wins in that stretch. On July 27, Cain allowed an unearned run in seven innings, earning the win in a 2–1 victory over the Phillies. Cain had one strikeout and one walk in the game, ending his Giants' record (since 1900) of 39 consecutive starts with more strikeouts than walks. On September 18, Cain allowed five runs (three earned) in five innings and hit his fifth career home run against Esmil Rogers, earning the win as the Giants defeated Colorado 12–5. In 33 starts, Cain had a 12–11 record, 179 strikeouts, and 63 walks. His 2.88 ERA was eighth in the league, and his innings pitched were seventh in the league. He finished eighth in Cy Young Award voting.