The Montreal-based fighter will challenge welterweight champion (Ruthless) Robbie Lawler on July 11 at UFC 189 in Las Vegas.
UFC president Dana White made the surprise announcement Wednesday at a Las Vegas news conference on the organization's plan to beef up drug testing.
MacDonald (18-2) lost a split decision to Lawler (25-10 with one no contest) when they met at UFC 167 in November 2013.
MacDonald, ranked second among welterweight contenders, had been due to meet No. 6 Hector Lombard at UFC 186 in Montreal in April. But that fight was dropped after Lombard tested positive for steroids at UFC 182.
The MacDonald-Lawler title fight will be the co-main event of UFC 189 at the MGM Grand Garden Arena. The previously announced main event pits featherweight champion Jose Aldo against rising Irish star (The Notorious) Conor McGregor.
The 25-year-old MacDonald has had to bide his time for a 170-pound title shot.
White said in October that MacDonald would fight the winner of the UFC 181 main event between then-champion Johny (Bigg Rigg) Hendricks and Lawler in December.
Hendricks had defeated Lawler at UFC 171 in March to decide the successor to Georges St-Pierre.
MacDonald's title bout would take place in Canada, White said at the time.
But MacDonald was returned to the on-deck circle after Lawler won a split decision over Hendricks in their rematch and White opted to stage a third bout between Hendricks and Lawler.
When the 32-year-old Lawler elected not to fight until this summer, the UFC matched Hendricks against Matt (The Immortal) Brown at UFC 185 in Dallas next month and MacDonald was given the Lombard bout.
The welterweight title picture was reshuffled again Wednesday. The UFC offered no reason for the change.
MacDonald, a native of Kelowna, B.C., who fights out of Montreal, is bidding to join St-Pierre and Carlos (Ronin) Newton as the only Canadians to hold a UFC championship.
Featherweight Mark (The Machine) Hominick of Thamesford, Ont., and Montreal middleweight Patrick (The Predator) Cote lost title fights in the UFC. Alexis Davis failed in a bid for the women's bantamweight crown.
Follow @NeilMDavidson on TwitterSuggest a correction