Couple of observations on Custom DNS facility and a couple of questions.
The name Custom DNS is not the best I suggest. Perhaps Local Hostnames might be better (possibly need to put my tin hat on )? Any entry in /etc/hosts is going to be a local hostname, is it not? You could argue that Pi-hole itself is a custom DNS .
Pulling in the current content of /ect/hosts for a user to see might be useful. What will happen if a hostname is duplicated? Should this be avoided at all costs?
Perhaps add a comment in hosts file, to not add entries but to use the internal facility?
How does this facility interact / impact with the advanced DNS settings? I am thinking of -
Never forward non-FQDNs (currently checked)
Never forward reverse lookups for private IP ranges (currently checked)
Use Conditional Forwarding (currently un-checked)
I'll admit I have never been completely comfortable that I understand what these settings actually do.
I currently have a number of static IP entries in my /etc/hosts that are subdomains of a registered domain that I only use internally (SSL Certs issued by DNS), but this is different to the domain specified in the DHCP server (.local).
Yes its an accurate description.
You configure DNS servers here that Pi-hole itself will query if it doesnt know the answer (not on the blocklists or not cached).
Pi-hole reads this hosts file on startup/boot and creates local internal DNS A or AAAA records out of these hosts entries.
You could also configure pihole-FTL (dnsmasq) to not read this hosts file at startup:
pi@noads:~ $ man dnsmasq
Don't read the hostnames in /etc/hosts.
Pihole is a caching forwarding DNS server:
The hosts file is not really suited to create DNS records as it will only allow you to add A or AAAA records.
Scroll down half way in below posting of mine "If you create a file":
I would concur that Custom DNS -as a name- can be improved on.
However, to me, Local Hostnames doesn't quite hit the spot either, as that feature might be used to trap public hostnames and redirect them to a local resource as well (as it is, I currently do that in v4 myself -by appending to /etc/hosts- in order to mock various connectivity checks).
This feature was an external contribution which we might have checked more for proper function than for wording. Any suggestions for improvement are welcomed. You can either open a PR and discuss in there or discuss here we we'll make sure to commit the changes once there is agreement reached.
Instead of suggesting any other new wording for the feature, i would like to know a bit more about the functionality itself.
(I can't find any mentioning of this feature in the documentation.)
Recently I edited my /ect/hosts file to see hostnames instead ob IP addresses in the PiHole WebIF.
With the "Custom Host Records" or "Custom DNS" feature i can realize the same?
The existing content of the hosts file is not yet loaded into this table.
So maybe i have to start over wit the naming.
Wouldn't be a problem for me, if i am on the right track now with the functionality.
So how about this? I'd prefer to get this done soon so we can still put it into v5.0. I would really really like to see the release not getting delayed any further. However, for this, we need to absolutely freeze the code so we can do some final testing.