Edit /etc/pihole/local.list through the web interface

I've been creating domains for my local devices with /etc/pihole/local.list. I'd like to edit that through the web interface.

Please expand on this. You can already do something similar with the Pi-hole DHCP server (define host names).

A list of hosts. I use my router for DHCP. It doesn't seem to allow me to set a DHCP host.

Hi, without using pi-hole dhcp server it would be cool to add local host names in /etc/pihole/local.list but this file is erased and re-written on each run of pihole -g, i.e. at least once per week.
see : HOWTO: Using pi-hole as LAN DNS server - #8 by Gregory_Smith

Edit /etc/hosts instead.

1 Like

/etc/hosts is local to my pi hole host. I need a name known on my local network

You can edit Pi-hole's hosts file and the records will be used with Dnsmasq.

It works. Thank you !

Sorry for nectroposting but wait - what??

I'm using my router as DHCP and two Raspberry Zero as redundant DNS with pihole installed in each.

I just edited the /etc/pihole/local.list file so i have hostnames instead of IPs when browsing the web interfaces, this is the main reason why i'm editing the file.

According to your post this file will be overwritten every week? Is that true?

local.list was invented to keep pi.hole and the device's hostname out of gravity.list a long while back.

1 Like

I'm using the hosts file for stuff i actually want to redirect in my LAN (and it works great) when using public domain names and just noticed the lines added in the hosts file have higher priority over the local.list, nice.

Anyways, thank you for the reply!

1 Like

Implemented in v5.0 with "Local DNS Records". Edits a different file, but has the same purpose.

1 Like