Custom DNS - Observations

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 :grin:)? 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 :wink:.

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).

I'll try to answer as many possible.

If you mean below settings:

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).

Not exactly.
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
       -h, --no-hosts
              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":

The docs are the best source for that:

As he categorised this topic as Beta 5, I think @borpin is referring to the Beta 5.0 Custom DNS feature.

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).

What do you think of Custom Host Records, maybe?

Dont have yet :wink:

No sorry, I meant this


I could live with that.

1 Like

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.

1 Like

It is a really useful feature, just needs a bit of expanding to explain it.

I think the name suggestion from @Bucking_Horn is a good one although I might go for Local Host Records.

Or we could follow the Monty Python approach and name it "the section until recently known as 'Custom DNS'" :grinning:


Did I hear you say "Ni" ?
RIP Terry.


Just to note, the person responsible for that section has been sacked.


Have you sacked the persons responsible for the sacking as well ?
Team team team!

1 Like

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.

Yes you can :slight_smile:

You can copy&pasting transfer into /etc/pihole/custom.list

1 Like

OK, thanks.

It's working

Love this new feature/functionality adding all my devices under .lan - smooth!

As for the name....I figured it out so "Custom" is OK, possibly "User DNS config", "Local DNS config" or "DNS Override" (assuming this functionality takes priority?)

No, the priority is:

  1. Configured in a config file in /etc/dnsmasq.d/
  2. Read from /etc/hosts
  3. Read from the list containing the device's host name and pi.hole (stored in /etc/pihole/local.list)
  4. Read from the "custom DNS" list (stored in /etc/pihole/custom.list)

Only the first record will trigger an address-to-name association.

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.

I think it's to close to /etc/hosts. Users likely will not understand the difference between this page and /etc/hosts and wonder if (or why not) this page edits /etc/hosts directly.

I think "Custom DNS configuration" or "Local DNS config" is better

"On this page you can add domain/IP associations." Drop off the reference to /etc/hosts.

Edit: And change "List of Custom DNS domains" to "List of Local DNS records."