More than one "Conditional Forwarding" entry in the GUI

What is the maximum number of entries for conditional forwarders?

I have tried to define more than 20 and it has not worked.
Is there a limit?

I'm not aware of a limit. Please post the exact error message you got and ideally also the lines you added and we can work from there.

As another example of how this could be useful, I want to set up a SteamCache server on the same network as my pihole, but I don't want to have to daisychain all my DNS reqs through the cache servers DNS server.

1 Like

I've got a simple use-case here, multiple internal domains.... Especially if you have multiple site to site VPNs.

1 Like

I have more than one local domain which should be resolved by one local DNS-server.
Currently my setupVars has following entries:

CONDITIONAL_FORWARDING=true
CONDITIONAL_FORWARDING_IP=123.456.789.1
CONDITIONAL_FORWARDING_DOMAIN=mydomain
CONDITIONAL_FORWARDING_REVERSE=123.456.789.in-addr.arpa

How can I add more local domains?

I have also multiple internal domains: HomeLab, SmartDevices, HomeComputers. It would be nice to have this in web interface.
Thanks.

1 Like

You can easily do this with custom dnsmasq config files in /etc/dnsmasq.d/ You can check for how it is done with the files created by Pi-hole to see how to do it yourself.

As far as I see, the web interface actually tries to stay simple instead of becoming a full network management system (I think this has been stressed by @DanSchaper) . The typical user is a first-time network user and has no idea about all the concepts of DHCP and other wizardry terms.

What I absolutely love about Pi-hole is that they try to keep it simple for the average user who you wants to put this next to their router, set up and forget, however, still offer enormous flexibility by allowing almost anything you can imagine by their open architecture. Unlike similar projects, you can fairly easily edit all the config files (mostly in /etc/dnsmasq.d) to realize arbitrarily complex networking configurations. I removed "fairly" because you can ask anything here on the forum and there will be someone who walks you through and can give a lot of insight into things (also when there is an easier way to achieve what you are looking for). This is the second most important bit of why Pi-hole is fantastic and "successful".

Are there any special file names required?
How can I check if the config file is loaded by FTL?

Pihole uses

/etc/dnsmasq.d/01-pihole.conf
/etc/dnsmasq.d/02-pihole-dhcp.conf
/etc/dnsmasq.d/04-pihole-static-dhcp.conf"

They filenames have the pattern [0-9,0-9]-name.conf

The pattern is specified in /etc/dnsmasq.conf

Anything *.conf will work, I have seen posts by developers suggesting something like 99-something.conf

There isn't much you can do to check (you could add an invalid setting to see if it fails), otherwise, you can trust that all files in this directory, ending in .conf will be read.

1 Like

Any file extension will be recognized, not just ".conf". Be careful that old files are not stored in the /etc/dnsmasq.d directory, because even with an extension like ".old" or ".bak", they will still be read by dnsmasq and used.

This command will check the configuration syntax:

pihole-FTL dnsmasq-test

2 Likes

I have another use case here, which could justify at least a second row of input fields for the two IP protocols.

1 Like

Ah, yes, sorry. I still have this in my ToDo list but too many real-life things have been pushing things back. I will move this higher on my ToDo list now...

Work-in-progress

Note that this is not yet functional as the underlying settings saving still needs to be adjusted for this (needs a core change).

8 Likes

If you are updating the GUI, may I suggest this. The Conditional Forwarding help text notes "One solution for this is to configure Pi-hole to forward these requests to your DHCP server." Could you expand on "these requests" in the help text please? What are "these requests" in this context exactly. It may be obvious to some, but not so to those new to Pi-hole. :confused:

1 Like

would i be able to use conditional forwarding in the conf file to define 2 domain controllers?

i.e.
server=mydomain.com/192.168.100.2
server=mydomain.com/192.168.100.3

Yes, it even says this in the dnsmasq man page:

More than one --server flag is allowed, with repeated domain or ipaddr parts as required.

That said, your syntax is missing the leading forward slash after your equal signs. Yours should be:

server=/mydomain.com/192.168.100.2
server=/mydomain.com/192.168.100.3
1 Like

Yes, second this as well! Maybe as a compromise, so there would be no extra bloat on the Web GUI, there could be a "+" button which adds a new text entry field for a conditional forwarder. Or... show/hide normal/expert menu items in settings, that a lot of other products do it that way.