I recently upgraded to v6 and discovered that the dnsmasq option "localise-queries" can't be manually set anymore, instead it is always on. Is this intended?
I tried to manually disable the options in /etc/pihole/dnsmasq.conf which is absolutely useless as it gets overwritten on every restart of pihole-FTL.
I have some custom host-records which should return 2 or more IP addresses, which is obviously not working with this option enabled.
Did anyone else stumble upon this problem?
Any help would be appreciated
localise-queries has been in effect ever since Pi-hole 3 released in 2017.
How so?
Please upload a debug log and post just the token URL that is generated after the log is uploaded by running the following command from the Pi-hole host terminal:
If I query test.lan from within the subnets I will, as expected, only get a single IP in return. The only way to get both IPs is to disable the localise-queries option, which is not possible anymore.
This could be covered by a simple check-box in the WebGUI.
I've already tried these options, but without success.
As far as I understand pihole-FTL uses /etc/pihole/dnsmasq.conf as primary config file and then adds the custom config either through the additional files in /etc/dnsmasq.d/ or by appending them to /etc/pihole/dnsmasq.conf.
But since the option localise-queries is baked into the primary config file there is no way to disable it in the custom config options.
You're right, but the dnsmasq specific settings in /etc/pihole/pihole.toml are written to /etc/pihole/dnsmasq.conf and then used by pihole-FTL.
I cannot edit /etc/pihole/dnsmasq.conf as it is overwritten each time pihole-FTL is restarted.
It can only work it the localise-queries setting could be set in /etc/pihole/pihole.toml.
There never was a UI option for it, so you only may have changed 01-pihole.conf - but that would never have been a persistent change then, as 01-pihole.conf may have been overwritten upon UI interaction or on Pi-hole updates.
That would only be expected if your Pi-hole host machine would sport an IP address for each of those subnets.
Since you didn't share a debug token yet, I can't know about that, but commonly, the machine hosting Pi-hole would only live in one of those subnets.
Why is it important that test.lan gets resolved to two IPs?
Is it equally important for both of your subnets?
I used my own conf file before v6. All files generated by pihole were replaced.
My pihole aswell as my client have their IP in 192.168.1.0/24. So when my client queries test.lan isn't the whole purpose of localise-queries to give me a reply in relation to my requesting IP?
I also have a client which is in a different subnet and it gets both IPs returned instead of a single.
Yes. I have some services which should be reachable on both IPs under a single name.
Also do mind that the first domain name is treated differently:
$ man dnsmasq
[..]
--host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-ad‐
dress>][,<TTL>]
Add A, AAAA and PTR records to the DNS. This adds one or
more names to the DNS with associated IPv4 (A) and IPv6
(AAAA) records. A name may appear in more than one --host-
record and therefore be assigned more than one address. Only
the first address creates a PTR record linking the address
to the name. This is the same rule as is used reading hosts-
files. --host-record options are considered to be read be‐
fore host-files, so a name appearing there inhibits PTR-
record creation if it appears in hosts-file also. Unlike
hosts-files, names are not expanded, even when --expand-
hosts is in effect. Short and long names may appear in the
same --host-record, eg. --host-record=laptop,laptop.thekel‐
leys.org,192.168.0.1,1234::100
If the time-to-live is given, it overrides the default,
which is zero or the value of --local-ttl. The value is a
positive integer and gives the time-to-live in seconds.
ph6c.home and ph6c will be an alias for ph6c.home.dehakkelaar.nl:
$ man hostname
[..]
THE FQDN
The FQDN (Fully Qualified Domain Name) of the system is the name
that the resolver(3) returns for the host name, such as, ursula.ex‐
ample.com. It is usually the hostname followed by the DNS domain
name (the part after the first dot). You can check the FQDN using
hostname --fqdn or the domain name using dnsdomainname.
You cannot change the FQDN with hostname or dnsdomainname.
The recommended method of setting the FQDN is to make the hostname
be an alias for the fully qualified name using /etc/hosts, DNS, or
NIS. For example, if the hostname was "ursula", one might have a
line in /etc/hosts which reads
127.0.1.1 ursula.example.com ursula
If that Pi-hole host doesnt have multiple IP's in different subnets, that localise-queries directive wont apply/do anything:
$ man dnsmasq
[..]
-y, --localise-queries
Return answers to DNS queries from /etc/hosts and --inter‐
face-name and --dynamic-host which depend on the interface
over which the query was received. If a name has more than
one address associated with it, and at least one of those
addresses is on the same subnet as the interface to which
the query was sent, then return only the address(es) on that
subnet and return all the available addresses otherwise.
This allows for a server to have multiple addresses in
/etc/hosts corresponding to each of its interfaces, and
hosts will get the correct address based on which network
they are attached to. Currently this facility is limited to
IPv4.
pihole 1 only gets returned a single IP because it is in the same subnet as one of the configured host-records and pihole 2 gets returned two IPs because it is in another subnet.
Thats indeed the expected replies.
What do you expect as a reply for that test.lan domain in both networks?
Bc clients in subnet 2 192.168.11.0/24 wont be able to connect to the 192.168.10.10 or 192.168.15.10 replies (EDIT: without an extra static route).