# How to make Pi-hole pick a specific host name?

**URL:** <https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505>\
**Category:** Help\
**Created:** [September 12, 2019, 8:40pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505 "2019-09-12T20:40:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 12, 2019, 8:40pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/1 "2019-09-12T20:40:28Z")

</div>

When updating a while ago, my Pi-hole lost the ability to show host names instead of IP addresses in the admin panel. I was able to overcome this by manually editing some config file.  
But after this, my Pi-hole didn't show the names I assigned to devices in my router, but rather the ones that the devices use for themselves.  
For example, before the update, my android tablet was listed as something like _'tablet.local.domain'_ whereas now it is listed as _'android-38967b82fa5effbe.local.domain'_.

The reason might be that the router in fact propagates both names for the device:

```auto
pi@rpi:~ $ nslookup 192.168.100.75
75.100.168.192.in-addr.arpa name = Tablet.local.domain.
75.100.168.192.in-addr.arpa name = android-38967b82fa5effbe.local.domain.

```

Likewise, I only see cryptic names for any other Android device on my network. Unfortunately, I cannot change the name on the tablet itself.

Is there a way to make Pi-hole pick the nicer name, other than resorting to hard-coding names in _/etc/hosts_ ?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [September 12, 2019, 8:53pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/2 "2019-09-12T20:53:11Z")

</div>

> [@Bucking\_Horn](#):
>
> I was able to overcome this by manually editing some config file.

Did you edit `/etc/pihole/local.list`?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 12, 2019, 9:19pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/3 "2019-09-12T21:19:40Z")

</div>

> [@jfb](#):
>
> Did you edit `/etc/pihole/local.list` ?

No, not to fix the lost ability to show host names instead of IP addresses in the admin panel.

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [September 12, 2019, 9:33pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/4 "2019-09-12T21:33:02Z")

</div>

I misunderstood the problem.

You would map IP's to host names in `/etc/hosts`. The file `/etc/pihole/local.list` provides the name for the Pi itself and maps the name pi.hole to the Pi IP address (as does `/etc/hosts`)

Is there a way to make Pi-hole pick the nicer name, other than resorting to hard-coding names in _/etc/hosts_ ?

> [@Bucking\_Horn](#):
>
> Is there a way to make Pi-hole pick the nicer name, other than resorting to hard-coding names in _/etc/hosts_ ?

Unless you can clean this up in the router, no.

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 12, 2019, 9:44pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/5 "2019-09-12T21:44:39Z")

</div>

Thanks for your quick reply 🙂

> [@jfb](#):
>
> Unless you can clean this up in the router, no.

The router just gives me the option to assign a name to a given MAC address, which I already did. The cryptic name is obviously injected by the android device itself (where I can't change it).

How does Pi-hole derive at the host name to display for a given IP address, if there is more than one name for it ?

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [September 12, 2019, 9:53pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/6 "2019-09-12T21:53:26Z")

</div>

> [@Bucking\_Horn](#):
>
> How does Pi-hole derive at the host name to display for a given IP address, if there is more than one name for it ?

If it doesn't get if from the router, it looks in /etc/hosts. I recall that the hosts file will override the router name. Add a few IP's to the hosts file and see if this shows the name you want. Here are a few examples of entries I have in the Pi hosts file - these are the names that show in the Pi-Hole web admin interface.

```auto
192.168.0.1 Router
192.168.0.100	Pi-3B+
192.168.0.101	AirportExtreme
192.168.0.102 Printer
192.168.0.108	Sonos1L
192.168.0.109	Sonos1R
192.168.0.110 SmartThings-hub

```

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 12, 2019, 10:29pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/7 "2019-09-12T22:29:54Z")

</div>

Yes, I am aware editing `/etc/hosts` will allow me to override router issued names, but that approach seems only feasible for devices with fixed IP addresses.

My current hosts file just contains my Pi-hole's name, so Pi-hole has to retrieve host names from my router - hence my question how Pi-hole does derive at a single host name if the router offers multiple names.

But that is more out of curiosity, and perhaps a bit to weigh if this could be rephrased into a feature request or whether this is not accomplishable at all.

What do you think, would this make a promising candidate for a feature request? 😉

No need to rush an answer, I have to log off now anyway to catch some sleep - thanks for your help today 🌻

---

<div class="post-metadata">

**Author:** ![jfb](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/jfb/32/4332_2.png) [@jfb](https://discourse.pi-hole.net/u/jfb)\
**Post date:** [September 12, 2019, 10:36pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/8 "2019-09-12T22:36:21Z")

</div>

The solution likely exists already - use Pi-Hole as DHCP server. You can assign static leases, etc.

> [@How do I use Pi-hole's built in DHCP server (and why would I want to)?](https://discourse.pi-hole.net/t/how-do-i-use-pi-holes-built-in-dhcp-server-and-why-would-i-want-to/3026):
>
> Using Your Existing Router For Network-wide Ad Blocking You might not need to use Pi-hole's DHCP server: In many home environments, your router also functions as your DHCP server. In this case, you can often [set Pi-hole to be the DNS server for your network clients in the router's DHCP (or LAN) settings page](https://discourse.pi-hole.net/t/how-do-i-configure-my-devices-to-use-pi-hole-as-their-dns-server/245), which allows all of your network clients to block ads simply by connecting to the network. Setting it up this way is also what makes Pi-hole very powerful for network-wide ad blocking. W…

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 15, 2019, 4:22pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/9 "2019-09-15T16:22:04Z")

</div>

I like your way of thinking, jfb - you really try to find a solution within the given limitations and available feature sets of Pi-hole 🙂

For now, I chose to follow your suggestion and enabled DHCP again, as it was helpful anyway when trying to assist with [Pihole plus Guest Wifi on different IP range](https://discourse.pi-hole.net/t/pihole-plus-guest-wifi-on-different-ip-range/23529)

I dimly recall I had my reasons when deciding to use Pi-hole as DNS-server only, but I can't recall why (lack of documentation on my behalf 😢).

I'll keep playing around with it for just a bit more and let you know if this fits my setup.

Thanks for your help so far!

---

<div class="post-metadata">

**Author:** ![mikeyw64](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mikeyw64](https://discourse.pi-hole.net/u/mikeyw64)\
**Post date:** [September 15, 2019, 5:44pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/10 "2019-09-15T17:44:55Z")

</div>

one of the reasons I went with using PiHole as the master DHCP was because there are various paremeters on the ISP facing router that I can't edit/change.

There are

a) the hostname of the router  
b) change the static DNS issued by the router (it always tells clients to use itself and then it looks at whatever DNS you have told it to use)

Upshot of this was that all queries for all devices going through this router appeared to come from the router and not from the individual devices.

---

<div class="post-metadata">

**Author:** ![mikeyw64](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mikeyw64](https://discourse.pi-hole.net/u/mikeyw64)\
**Post date:** [September 15, 2019, 5:55pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/11 "2019-09-15T17:55:20Z")

</div>

@Bucking_Horn

This might be helpful if you want Devices to have a more friendly host name but still be issued Dynamic IPs (although it does still need populating)

At the bottom of the DHCP conf page in the web gui it says

"Specifying the MAC address is mandatory and only one entry per MAC address is allowed. If the IP address is omitted and a host name is given, the IP address will still be generated dynamically and the specified host name will be used. If the host name is omitted, only a static lease will be added."

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 15, 2019, 7:39pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/12 "2019-09-15T19:39:08Z")

</div>

Thanks, I'll give that a try sometime during the week.

For now, weekend's over 😉

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 27, 2019, 12:07pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/13 "2019-09-27T12:07:00Z")

</div>

> [@jfb](#):
>
> The solution likely exists already - use Pi-Hole as DHCP server. You can assign static leases, etc.

> [@Bucking\_Horn](#):
>
> I’ll keep playing around with it for just a bit more and let you know if this fits my setup

So, I have used Pi-holes DHCP for some time, but are not really comfortable with it.  
While it allows me to manipulate host names, it is somehow limited in doing so.

It seems Pi-hole currently allows only one entry per MAC, defining a host name and one IP address with it.  
But alas, some of my devices have several IP addresses. I can get rid of a lot of them by disabling IPv6, but some devices remain.

This is owed to a specialty in my setup:  
I have caged my TV into a separate wifi subnet (with limited range) to prevent it from using DNS servers of their own devisal (I achieve this by NATing the DNS requests to Pi-hole).

I now use some of my devices (smartphone, tablet) as a remote control for that TV. This forces those devices to a roaming usage of the TV's wifi and the normal wifi.  
Pi-hole allows me to issue a static lease just once per MAC, which limits static lease usage to just one sub-network. As Pi-hole is not fully aware of the second subnet (TV), the device ends up with different IPs almost any time it's connecting. Over time, this leads to a whole bunch of different IPs clogging up in the Query Log that are actually associated with just one device.

I acknowledge that while it doesn't match my special needs, all proposed solutions are well worth trying in a conventional plain vanilla setup.

I have since switched back to my DNS only Pi-hole.

When doing that, I encountered an error:  
Switching off DHCP with static leases configured leads to a situation where Pi-hole refuses to restart FTL. This seems to be caused by a leftover file `/etc/dnsmasq.d/04-pihole-static-dhcp.conf`, but `syslog` also complains about permissions on `/var/lib/misc/dnsmasq.leases`.  
Deleting the file and restarting the Pi-hole machine resovled this for me.

Are you already aware of this, or would you want me to open an error topic?

---

<div class="post-metadata">

**Author:** ![PatienceofStone](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@PatienceofStone](https://discourse.pi-hole.net/u/PatienceofStone)\
**Post date:** [September 27, 2019, 2:29pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/14 "2019-09-27T14:29:33Z")

</div>

This sounds very similar to the behavior I see with IPv6.

My router provides DHCPv6 that cannot be turned off, which in turn leads to highly mobile devices such as cell phones and tablets to be assigned new IPv6's frequently.

Leading to my log files being full of hexadecimal listings that are all really just one or two devices.

I asked a question here (no responses yet) about IPv6 specific conditional forwarding, but maybe it would be more useful to have "IP range" conditional forwarding so that whether it's an internal subnet (your TVNet example) or my router IPv6 issue, the Pi-Hole could resolve and concatenate under the assigned DNS name.

Or maybe a way to "tag" MAC addresses with a name so that no matter what IPv4 or IPv6 they end up using they are logged as the designated name? (Though this wouldn't scale in a SMB or Enterprise environment, it could be a good "gap" measure until the IP conditional forwarding makes it into the Development cycle.)

---

<div class="post-metadata">

**Author:** ![mikeyw64](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mikeyw64](https://discourse.pi-hole.net/u/mikeyw64)\
**Post date:** [September 27, 2019, 2:56pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/15 "2019-09-27T14:56:00Z")

</div>

Re tagging mac addresses with a name, yes you can, no idea if it will help though

> [@How to make Pi-hole pick a specific host name?](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/11):
>
> @Bucking_Horn This might be helpful if you want Devices to have a more friendly host name but still be issued Dynamic IPs (although it does still need populating) At the bottom of the DHCP conf page in the web gui it says "Specifying the MAC address is mandatory and only one entry per MAC address is allowed. If the IP address is omitted and a host name is given, the IP address will still be generated dynamically and the specified host name will be used. If the host name is omitted, only a st…

---

<div class="post-metadata">

**Author:** ![PatienceofStone](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/p/eb8c5e/32.png) [@PatienceofStone](https://discourse.pi-hole.net/u/PatienceofStone)\
**Post date:** [September 27, 2019, 3:07pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/16 "2019-09-27T15:07:42Z")

</div>

That works for fully dynamic, but I haven't figured out how to make it work in a mixed environment.

E.g. for IPv4 I use a firewall to ensure that my devices are unfiltered, but for my friends and family the network is "filtered" a bit more strictly (I have underage nieces...).

In my specific case, I assign a static IPv4 to my devices for this filtering, but can't do anything about IPv6 due to my carrier's hard-coded configs on the router.

Now if that same configuration area could handle both a static IP and a masquerade "un-IP'd" name it would work.

Maybe it's a bit less coding work to perform the duplicate check for MAC, validate that the IP assignment is "NULL" on the duplicate and allow it with a warning /verification?

---

<div class="post-metadata">

**Author:** ![mikeyw64](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mikeyw64](https://discourse.pi-hole.net/u/mikeyw64)\
**Post date:** [September 27, 2019, 3:20pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/17 "2019-09-27T15:20:46Z")

</div>

in which case it might be better doing custom queries direct on the DB as outlined here

> [@Exporting PiHole Stats for use in Excel](https://discourse.pi-hole.net/t/exporting-pihole-stats-for-use-in-excel/23726):
>
> This is the way I do it. The example below exports the date timestamp in human readable format, the domain that was looked up and the [status code](https://docs.pi-hole.net/ftldns/database/#supported-status-types) for all queries from a specific client . I am then running samba so I can retrieve the file from my laptop and open in excel so I can run it through a pivot table. Obviously this can be expanded upon as required pi@Heimdall:~ $ sqlite3 "/etc/pihole/pihole-FTL.db" SQLite version 3.27.2 2019-02-25 16:06:06 Enter ".help" for usage hints. sqlite\> .head…

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 27, 2019, 8:55pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/18 "2019-09-27T20:55:29Z")

</div>

I asked for instructions on picking a specfic host name from a given list of supposedly many.  
Setting up DHCP was proposed as a possible solution by @jfb, which I tried for a few days and now commented on.

I have no difficulties with IPv6 whatsoever, nor do I struggle with hostnames in general, so your problem seems completely unrelated.

In case I missed your point: Would you care to elaborate on which solution you are offering for my problem?

---

<div class="post-metadata">

**Author:** ![Bucking\_Horn](https://discourse-cdn.pi-hole.net/user_avatar/discourse.pi-hole.net/bucking_horn/32/18719_2.png) [@Bucking\_Horn](https://discourse.pi-hole.net/u/Bucking_Horn)\
**Post date:** [September 27, 2019, 8:57pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/19 "2019-09-27T20:57:28Z")

</div>

> [@mikeyw64](#):
>
> in which case it might be better doing custom queries direct on the DB as outlined here

😕 I don't get it: How does that help me making Pi-hole pick a specific host name?

---

<div class="post-metadata">

**Author:** ![mikeyw64](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@mikeyw64](https://discourse.pi-hole.net/u/mikeyw64)\
**Post date:** [September 27, 2019, 10:06pm UTC](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505/20 "2019-09-27T22:06:12Z")

</div>

@Bucking_Horn

that was more a lateral suggestion for @PatienceofStone

Now where's that darned quote button!!!

Ah blockquote, copy'n'paste

What a PITA ;o)

[Next page](https://discourse.pi-hole.net/t/how-to-make-pi-hole-pick-a-specific-host-name/23505.md?page=2)
