The problem is that this blocks the ad domains and the YouTube client on my smart TV goes into a loop looking for working servers. However, someone else found that if you simply redirect these requests to googlevideo.com they are handled and the video plays.
So I need to redirect everything matching the regex to googlevideo.com.
What about BLOCKINGMODE? That lets you select redirecting blocked domains to the Pi's local IP address and a page where you can whitelist. Is there some way I can change that to redirect everything to do googlevideo.com instead?
I don't think you can redirect, using regex, however, A solution for individual redirects can be achieved. This has been explained here, for safe search.
for your redirect, this would imply this hosts (/etc/hosts) entry:
172.217.17.36 googlevideo.com
or whatever googlevideo.com resolves to in your area
and a dnsmasq configuration file (/etc/dnsmasq.d/97-redirect.conf), containing the following:
cname=<the domain name you want to redirect>,googlevideo.com
you can enter as many redirections as you want to, just duplicate the cname entry and change <the domain name you want to redirect>
The down side of this approach is you will have to restart pihole-FTL every time you change the configuration file.
Don't know if this a solution for what you're trying to achieve...
Thanks jpgpi250. I was aware you can do it that way with IP or domain redirects, but the problem is that Google has a vast number of servers offering up Google video and there is no way to find them all, hence the regex.
Someone made a script that adds the advertising domains after the first time they are used, but obviously it's not as robust as the regex.
I'd be happy to have a PiHole just for YouTube where all blocked domains are redirected to googlevideo.com. Maybe there is some way to reconfigure what BLOCKINGMODE=IP does.
NOT sure this will work. When using blocking mode IP, the IP addresses (IPv4 and IPv6) are read from /etc/pihole/setupVars.conf. You could try changing the IP addresses in this file, EVERY bllocked domain would than be redirected to these IPs
NOT sure what happens if the weekly pihole -g OR pihole -up runs. Pretty sure pihole -r will undo the configuration change.
Hmmm... Well I'm sure we can fix the configuration overwrite. Isn't the IP addressed in setupVars.conf used for the web UI though? I'll give it a try anyway.