It can filter out DNS requests in the whole network for ads/tracker domains if used as the DNS resolver on your network, which would also include other devices (e.g. phones). Most smartphone apps perform a lot of tracker requests, which makes this approach very effective IMHO.
What the network approach doesn't help with is when the ads are served from the same domain as the content. An extension like uBlock Origin solves this problem because it filters the content within the browser.
So I think both approaches are necessary to filter out ads/trackers, and they also complement each other, one at the network level (dnsmasq or Pi-Hole) and the other at the browser/content level (uBlock Origin, PrivacyBadger).
- It works for every application on your computer, not just web browsers that also support adblocking addons. Useful for applications with embedded web browsers (game clients, chat clients, etc).
- The failure mode is to block rather than allow. Even with a browser with adblocking addons, the addon could accidentally be disabled or uninstalled (by you, by a browser bug, by a browser feature, etc), so you'll start seeing ads. If the DNS server gets disabled you won't be able to resolve anything, let alone see ads.
(I used to do a home-made version of this, but resolving to a local gifserv so that I didn't have to see "page could not load" errors from ad spaces. But recently I got a pfsense router so I've switched to pfblockerng instead.)
With uBlock Origin/uMatrix, it's possible to block all Facebook domains on every site except on facebook.com itself. With DNS-based blocking that sort of nuance isn't possible; it's an all-or-nothing approach.
What the network approach doesn't help with is when the ads are served from the same domain as the content. An extension like uBlock Origin solves this problem because it filters the content within the browser.
So I think both approaches are necessary to filter out ads/trackers, and they also complement each other, one at the network level (dnsmasq or Pi-Hole) and the other at the browser/content level (uBlock Origin, PrivacyBadger).