In my intranet, where hosts are in a subnet 192.168.2.0/24 and domain names in a domain mydomain, I use BIND9 as DNS, running on host intradns.mydomain , and NGINX as a webserver running on intraweb.mydomain.
I would like to rewrite all subdomains of certain public domains (spammers and trackers) using my intranet DNS to a webserver that answers every request with a 1 x 1 transparent Pixel GIF.
Note: A user has to be fully aware that the result is not the internet according to public DNS anymore but a modified view of it.