For youtube ads, essentially, Google has an entire array of domains to point to. Which is why it seems hard to pin down YouTube adblocking for Pihole.
I've been testing out and gathering data about the domains for entire
GoogleVideo parent domain (seems to be the only connection for all the ad domains). Using wildcards through the dnsmasq.d doesn't work. Youtube will not playback any video at all. The only way to stop ads from rolling is to blacklist them one by one.
Luckily, it seems that you only need to add this seemingly simple domain structure in the
pihole -b domain1 domain2 ... command :
where N is the beginning and M is the end. (Basically recursively adding the domains.)
Each domain starts with an
r followed by a number. This number doesn't seem to go beyond 20. It is then followed by either three dashes, its unique ID (fingerprint) then
Sometimes, the domain doesn't have the three dashes:
Basically, to block an entire unique ID domain, you have to know the fingerprint of each and every variants (from r1 to r20).
So far I've found these fingerprints:
By knowing this, you are creating a whole entire array of possible ad-serving DNS for youtube. But using this means that you'll end up having 100s or even 1000s of googlevideo domains.
Edit: This also takes care of ads going to mobile and Chromecast. But knowing the whole entire fingerprint army is another question.
Edit 2: You can help ID the
fingerprint army by using
Whitelist Assistant by DNSThingy for Chrome, and surf youtube and watch cat videos. If you spot an ad, open the extension and take note of the fingerprint and post it here.