DNS Rules

Is there any way to setup dns rules using pinhole.

For instance, I use smart dns from a provider and I want to setup a rule such that few dns query based on rules will be looking or forwarding dns query to a specific dns and rest dns traffic will go through normal route for dns query.

Have a look at Pi-hole's Conditional Forwarding, configurable under Settings | DNS, and see if that would match your requirements.

If I am not wrong Conditional Forwarding is to set rules for a CIDR network devices to point to a specific IP address for a domain. But I cannot use specific DNS Server to be used when trying to open a specific Domain.

My requirement is like for Example:
the domain is www.google.com
Custom DNS Server: 1.1.1.1
Default DNS Server: 4.4.4.4

Now, I want to setup a way where when I open www.google.com it uses the custom DNS Server for querying i.e use 1.1.1.1 DNS server and for other websites like xyz.com it uses Default DNS Server i.e 4.4.4.4 for querying.

Use the server command from dnsmasq. Make a new configuration file in directory /etc/dnsmasq.d with the configuration lines. Then restart pihole-FTL.

https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html

1 Like

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