More than one "Conditional Forwarding" entry in the GUI

Hi all,

while I understand that in most cases one "Conditional Forwarding" rule is sufficient, there are situations where you'd want more than one entry. In the "Upstream DNS Servers" section above you can enter multiple servers, it would be nice to have multiple "Conditional Forwarding" entries as well.

Thanks!

Could you give an example of how or when this would be used and why it would be helpful?

When forwarding to a Ubiquiti USG, then the localdomain forwarding like

server=/my.local.domain/192.168.1.1

is not enough. There are also rules like

server=/setup/192.168.1.1
server=/setup.ubnt.com/192.168.1.1
server=/unifi/192.168.1.1
server=/USG/192.168.1.1

necessary to resolve UBNT internal names. Currently I'm doing this with a /etc/dnsmasq.d/05-custom.conf and everything is well, I just thought that adding additional fields to the GUI would be nicer.

5 Likes

Hi sbellon and jfb,

Same problem here. I'd like several "Conditional Forwarding" as I've got my local LAN (10.0.0.1), my Google WiFi Mesh (192.168.86.1) and two VPN Servers (10.8.0.1 and 10.9.0.1) which all use my Pi-Hole on Raspi with LAN and WiFi to filter DNS. It is

server=/testwifi/192.168.86.1 # Google WiFi
server=/lan/10.0.0.1 # Local LAN
server=/openvpn1/10.8.0.1 # VPN1
server=/openvpn2/10.9.0.1 # VPN2

I'd do it also through the config files if its possible?

Config files works perfectly, as mentioned in my post.

@anon55913113 and @sbellon thanks a lot, works like a charm :slight_smile:

@anon55913113 thanks again, yes, I messed up my config file with the hash signs as if comments...

@jfb Another real world use case would be for local domains that span multiple subnets. When you configure conditional forwarding, it assumes the reverse lookup subnet based on your configured router IP. In mycase i'm just using "local" but i'm using it on 3 different subnets/vlans.

I've had to create a custom file like @anon55913113 but just with additional reverse zones:

 pi@ns01:~ $ cat /etc/dnsmasq.d/02-custom.conf
 server=/4.81.10.in-addr.arpa/10.81.0.6
1 Like

Adding more and more features that will only be used by a few experts out there seems to be not a good idea. Each new feature can bring new issues along and the more complex the entire system becomes, the more complicated and possibly less straightforward the interface becomes for the arbitrary user.

We deliberately allow experienced users to configure anything they want by placing custom configuration files into /etc/dnsmasq.d/. This allows for a much greater flexibility than could ever be possible with a GUI.

5 Likes

A post was split to a new topic: Conditional forwarding help

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