Documentation on "Local DNS Records"

I was wondering what the purpose of "Local DNS Records" page is when compared to the DHCP page where we define the hostnames .

Local DNS records are similar to the /etc/hosts file, but stored in /etc/pihole/custom.list. They store local mappings of IP to client names.

If you have hostnames define in your DHCP settings, you typically do not need additional mapping.

Additional discussion here - note comment number 16 or 17, which discusses the priority among the various hosts files.

Apologies in advance if this is a silly question... I've been using the "Local DNS Records" feature with PiHole for some time now... However, when I went looking for this feature, I found a web page that recommended that I set up a file, "lan.list" in /etc/pihole, then populate this with the "loal" names that I wanted to adopt.

I did so - the approach worked perfectly - and now I've got 21 local hosts (bit of an extensive R-Pi cluster going on) and a router all mapped in to this.

However, when I check the "Local DNS Records" using the web interface, I do not see any of my existing names... If I then check in /etc/pihole, I can see that the web interface us storing submitted data in the file "custom.list", whilst I've been using "lan.list"...

Interestingly, PiHole seems entirely happy to combine the results of the two files and use both when resolving names (adding a new value via the web interface creates and entry in "custom.list" and this works along side my "lan.list" entries.

Which takes me to a 2-part question:-

  1. Is it safe and acceptable for me to use the 2-file approach if I apply the "if it ain't broke, don't fix it" mindset?

  2. In the alternate, if I were to reformat "local.list" to match "custom.list", then rename "custom.list" to "custom.list.old" and "lan.list" to "custom.list", would this be a safe, viable way to import my existing 20 entries to the web-based DNS entry manager, or would it be safer to just add them all by hand, one at a time?

Thank you in advance for any guidance.

Bad advice from that web page. Don't make changes to this file. Use /etc/hosts or /etc/pihole/custom.list.

JFB, thanks for responding.

Here is the page that I found that recommended use of "lan.list"...

As you can see, it is listed here, on this very site. Having established that this is bad advice - and for anyone else who make come to this conversation in future - can you recommend the best way to fix this? Would it simply be a case of manually adding my intended DNS entries via the web GUI and then deleting the "lan.list" file from the /etc/pihole folder? (I did create the file in the first place, so your comment "Don't make changes to this file" is slightly confusing in that regard. Is it safe to delete? Or should I delete it and then "touch" it back into existence? Or something else?

Perhaps if you could lay out your recommendation as a couple of simple steps that would help others to follow.

Thank you

... and maybe, as a moderator... you might have the ability to deprecate, edit or remove the above post with the bad advice?

The post is from Nov 2016..

It's passed the edit window, but I can do some admin magic. Is there a post already existing that discusses the new feature?

Edit: Have added a notice at the top of the old post to say it is outdated, and hidden the details in an expander

1 Like