Brave, Firefox, Bromite all do, or you can use nextdns or adguard as a private DNS in your network settings. I think the last option is a little wireguard set up to route traffic to a server or small pc that has unbound and pinhole on it
dns blocking would only see the domain coolblog.org, and doesn't see that it loads ad.js, so it won't block anything.
But e.g. uBlock, also sees that your browser tries to visit ad.js, if uBlock had ad.js in its blocklists it can block loading this script.