Choose custom DNS depending on DNS request

Thanks!!! In fact thanks to everyone on this thread. It works!

The solution for anyone else who wants to do this (my main dns opendns family blocks all vpn requests) :

Workout what the main domain is you want to allow. In my case it always has surfshark.com in it, even if the subdomain varies per country.

Create a config file as root on your pihole in /etc/dnsmasq.d. I called it bypass.conf. Enter the domain you want to allow:

#adding surfshark bypass
server=/surfshark.com/9.9.9.9

9.9.9.9 is the quad 9 DNS im using for bypassing but any DNS will do for this which allows lookups to the domain you want.

Restart pihole dns:

/etc/dnsmasq.d# pihole restartdns

Thats it! Thanks again

1 Like