Federer - the defending champion and a five-time victor of this event - required less than an hour on Stadium 1 to get the better of the Serbian world number 28.
His title defence got off to a soggy start on Saturday night when play was suspended because of rain showers with Federer up a set and tied 2-2 in the second.
Novak Djokovic produced a puzzling performance as the former world number one lost to Japanese qualifier Taro Daniel in the second round at the BNP Paribas Open in California on Sunday. After another 90-minute delay organizers suspended play for the night.
He will face 25th-seed Filip Krajinovic in the third round.
Federer served six aces and broke the Krajinovic serve five times.
Both Djokovic and Edmund were making their first appearances since the Australian Open.
"It felt like the first match I have ever played on the tour, very weird", he told reporters.
Daniel had won two rounds of qualifying and then held off fellow qualifier Cameron Norris to book a first meeting with Djokovic.
Djokovic took six months off after Wimbledon a year ago and returned in January's Australian Open where he lost in the fourth round.
Djokovic scrambled to win the second set on Sunday but the rust from the lay-off was evident as he made 62 unforced errors overall.
"It is still early stages for Novak coming back and the first one after surgery".
Argentina's Juan Martin Del Potro (6) defeated Australia's Alex De Minaur 6-2, 6-1 to set up a third-round match with Spain's David Ferrer (29), who beat American Tim Smyczek 6-2, 7-6 (3).
Another surprise victor was Cyprus' Marcos Baghdatis, who beat Argentina's Diego Schwartzman, who is seeded 14th, 7-5, 6-4.