How to add internal DNS server for conditional forwarding

Normally my router is the default DNS forwarder. IP is 192.168.2.1.

But I also have a custom domain - my-lab.com -. I run an internal DNS server for my-lab.com with the IP Address 192.168.2.88. Now I want to add this server to my Pihole config. I want that Pihole redirect all DNS queries for .my-lab.com to 192.168.2.88 and all other DNS queries (except tracking and ad) to my default DNS forwarder - my internet router.

I found a lot of how-to's for redirecting specific hosts to internal IP's but none for redirecting a whole domain to an internal DNS server.

What settings do I have to set on my Pihole machine to make this work?

You need to create a custom config file for the embedded dnsmasq instance. A file like /etc/dnsmasq.d/custom.conf should contain server=/<domain>/<IP of NS>. This will instruct Pi-hole to forward all queries ending with <domain> to the specified IP address.

In your case server=/.my-lab.com/192.168.2.88

Ha!
server=/.my... did not work but server=/my... did. You pointed me to the right direction. Thank you!

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