Trying to setup custom domain forwarding in a .conf file

I'm trying to set up custom domain forwarding. To test the rule is working, I created:

/etc/dnsmasq.d/01-custom-forwarding.conf

with the contents:
address=/google.com/0.0.0.0

which didn't work, so I changed it to:

address=/google.com/0.0.0.0
address=/.google.com/0.0.0.0

which also didn't work so tried:
server=/google.com/0.0.0.0

which also didn't work.

Restarted all services etc, flushed my local DNS. I can see in the query log pihole is processing the query, but I am still able to access google.com (I'm just using this domain as a test case).

Just to be clear, my goal is not to block google.com, I am just trying this as a test to see if this file's contents is working. I know I can block domains using the GUI.

Any pointers on why my approach isn't working here? Thanks

That's not forwarding - rather, that would instruct Pi-hole to answer A requests ending in the label google.com with 0.0.0.0.

That's forwarding, instructing Pi-hole to forward resolution for domains ending in google.com to 0.0.0.0, but 0.0.0.0 likely wouldn't know heck about DNS.
You'd usually pick a public DNS server IP as forward target, or another local DNS server IP.

Pi-hole v6 doesn't read /etc/dnsmasq.d/ by default, see Custom dnsmasq configs not loading.

Either enable misc.etc_dnsmasq_d, or instead -for a few lines- add them directly to misc.dnsmasq_lines, as as accessible via Settings | All settings » Miscellaneous .
All settings is available in Expert mode only.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.