The issue I am facing:
I have a VPN configured on my router which forwards traffic from certain domains through a VPN.
I am trying to use pihole to forward queries for this domain to my router.
I have added the domain to (settings/miscellaneous) misc.dnsmasq_lines:
server=/example.com/192.168.1.1
to forward DNS lookups for this domain to the router (which runs a DNS server). The router will then apply domain based policy routing to forward the traffic through my work VPN.
The intent is to avoid needing to have the VPN on each local machine, bringing it up and down on demand, while still benefitting from pihole’s adblocking and local DNS for all other LAN traffic.
When I then run dig @my_pihole_ip example.com
I am returned:
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 5818
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; OPT=15: 00 17 ("..")
;; QUESTION SECTION:
;example.com. IN A
;; Query time: 36 msec
;; SERVER: 192.168.1.2#53(192.168.1.2)
;; WHEN: Sun Aug 17 11:05:20 BST 2025
;; MSG SIZE rcvd: 44
Tailing the pihole log provides the same: Refused, with nothing else. It is important to note that even domains NOT configured in policy routing return the same error, which has me thinking this is a misconfiguration (on my part) on my pihole.
Details about my system:
I have a Unifi gateway which runs a VPN client to connect to my offices.
I’ve a pihole configured locally which contains DNS records for my local network.
I am using Cloudflare 1.0.0.1/1.1.1.1 (DNSSEC) for upstream DNS servers.
I have 3 simple VLANs which DO NOT block traffic to one another (I honestly don’t need the headache). They’re for simple segmentation. The VLANs are on 192.168.1.x, 2.x and 3.x.
My pihole is configured to ‘Respond only on interface eth0’.
I’ve tried to not fiddle with anything as much as possible because, bluntly, I’m probably too dim. I could use the router as my DNS server and save myself a headache but I like Pihole (the blocklist that removes that stupid ‘sign in with Google’ is worth it’s weight alone) and I want to understand what I am doing wrong.
What I have changed since installing Pi-hole:
I have added the entry referenced above to Settings / Miscellaneous/ misc.dnsmasq_lines