Hostnames instead of IP in the dashboard - /etc/hosts edition

Hi,
My goal is to see hostnames instead of IP addresses in the dashboard.
My pi-hole is running in a container on a RPi3. It is NOT acting as my DHCP server (this one is still on my router).

Following the FAQ post show hostnames instead of IP addresses in the dashboard?, I went into my container (docker exec bash), installed nano in there and edited /etc/hosts.
It works well, I can now see my hostnames instead of IPs on the dashboard.

However, my fear is that next time I'll update my container to get a new pi-hole version, I'll have to redo all this.
Am I right ?
If yes, any way to make the /etc/hosts list persistent ?

If you want to use this file, you will need to add a volume to store the contents of this directory.

Did you try to use the file /etc/pihole/custom.list?


Note:

The order of locally defined DNS records is:

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

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

1 Like

OK, so I'll export it in a shared volume.

Since this file (/etc/pihole/custom.list) was not in the FAQ, I didn't try it.
I directly went with the /etc/hosts as specified.
I'll try with the file you are pointing to, and see if it has the same benefits.
I'd indeed prefer to share the /etc/pihole folder instead of the whole /etc.

I'll let you know what are the results.

Seems that the custom list file does the job !
I'll modify my compose script to export /etc/pihole folder !
Thanks !