Financial terms were not disclosed, but a source told ESPN that the deal is worth $24 million and includes $10 million in guarantees.
McDonald signed a one-year contract with the Dolphins in the spring despite being hit with an eight-game suspension for violating the NFL substance abuse policy. The suspension begins this week.
The Dolphins were so impressed with McDonald's play in training camp and the preseason and how he handled the suspension that the team wanted to keep him in Miami long term to pair with former Pro Bowl safety Reshad Jones.
McDonald played four seasons with the Los Angeles Rams before signing with the Dolphins. He has 285 tackles, five sacks and four interceptions since being drafted in the third round in 2013.