The bout will take place on July 27 at KeyArena in Seattle. UFC officials confirmed the bout on Wednesday, following an initial report by The Province.
ESPN.com ranks Ellenberger and MacDonald the Nos. 4 and 6 welterweights in the world, respectively.
Ellenberger (29-6) is fresh off a first-round knockout of Nate Marquardt at UFC 158 last month. The Omaha native has won eight of his past nine fights, including four finishes. His only loss came via TKO to Martin Kampmann last June.
Eager to return to the cage, MacDonald (14-1) hasn't fought since a unanimous decision over B.J. Penn in December. The 23-year-old Canadian had been scheduled to fight Carlos Condit at UFC 158, but fell off the card because of a neck injury.
MacDonald is on a four-fight win streak. He campaigned for the rematch with Condit, who is responsible for his only pro loss, but now draws Ellenberger. Condit fought Hendricks at UFC 158 and lost via unanimous decision.
The UFC has not announced a main event for the summer card. The welterweight bout between Ellenberger and MacDonald likely will take place on the main card.