DNS adblocking isn't even remotely comparable to ublock origin
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.