# How to show readable hostnames when Conditional Forwarding supplies only gobbledygook

**URL:** <https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668>\
**Category:** Help\
**Created:** [February 24, 2020, 11:27am UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668 "2020-02-24T11:27:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 24, 2020, 11:27am UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/1 "2020-02-24T11:27:19Z")

</div>

#### Please follow the below template, it will help us to help you!

## Expected Behaviour:

I insert the local ip of my router and the local domain to see the names of my clients instead of their ip.

## Actual Behaviour:

I use a fritz box and the local domain is fritz.box and now all of my clients sound like this  
"galaxy-s9.fritz.box". How canI change it to show just the name withouth the local domain of my network?

## Debug Token:

[https://tricorder.pi-hole.net/rnjmb7s4v6](https://tricorder.pi-hole.net/rnjmb7s4v6)

---

<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:** [February 24, 2020, 11:54am UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/2 "2020-02-24T11:54:14Z")

</div>

> [@AFArmyII](#):
>
> I use a frotz box (..)  
> How canI change it to show just the name withouth the local domain of my network?

As you are using a frutz.bax ;), you can't.

By enabling _Conditional Forwarding_, you are configuring Pi-hole to ask your FB to provide names for IP addresses. As of today, FB does neither allow changing the local domain (i.e. fritz.box) nor to suppress it when being queried for a name.  
Also, many network commands or applications will append hostnames by the local search domain automatically, so likely, other routers would behave similar to FB.

Instead of using _Conditional Forwarding_, you could resort to supplying local hostnames for IP addresses by editing Pi-hole's `/etc/hosts` manually.  
This will work reliable as long as a device's IP doesn't change, i.e. you configure your FB to use DHCP lease reservation to assign a _fixed_ IP address to a device.

Alternatively, you could disable DHCP in your FB and enable DHCP on your Pi-hole, supplying names through Pi-hole's DHCP settings pane, where you also could change the local domain name (but you may still see that domain being appended).

---

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 24, 2020, 12:38pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/3 "2020-02-24T12:38:22Z")

</div>

Hey, thx for your hint 😉

I've thought that it isnt possible...  
I know the other options you told me but since I have one device that schould never connect to the pihole the dhcp server is not an option and editing the hosts file seems to be pretty rough and some other guys around here said that its a forbidden fruit.  
So after all I think I just have to live with the stupid name endings. The clients are still recognizable.

---

<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:** [February 24, 2020, 2:20pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/5 "2020-02-24T14:20:43Z")

</div>

If you shy away from editing the `hosts` file, there may be another approach to assay, but it'll involve more manual editing, and you have to test for yourself to find out whether this will produce the names in your fashion, or whether _Conditional Forwarding_ still would take precedence (if enabled coexistingly).

You could try setting up a hostrecord with pihole-FTL for each client by adding a custom configuration file under `/etc/dnsmasq.d/`.

You can either do that completely manually from scratch, studying the [man page for dnsmasq](http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html) , or have pihole assist you by executing

```auto
pihole -a hostrecord <hostname> 192.168.178.<x>

```

Of course, you'd have to replace the \<bracketed terms\> with your respectively applicable values. Implemented FR [Domain Redirect - #3 by DL6ER](https://discourse.pi-hole.net/t/domain-redirect/1826/3) has more details on this.

Pi-hole is adding hostrecords to `/etc/dnsmasq.d/01-pihole.conf` by default.  
You should be aware that updating pi-hole may overwrite your changes in `01-pihole.conf`.

That's why I'd suggest moving the hostrecord lines into a separate custom configuration file, e.g. `/etc/dnsmasq.d/20-local-hostnames.conf`. Once you are familiar with the pattern, you should also be able to edit that file directly, but don't forget to restart when finished. 😉

---

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 24, 2020, 2:30pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/6 "2020-02-24T14:30:06Z")

</div>

Thank you for your advice. I think I'll go with the option I've discribed in my first post 😉  
The Question is: Why are some clients, like my smart-tv or my iPad not shown with their exact names. They are named like "N/A" or "com-mid1.fritz.box" even though I've renamed them. After all I've never seen these names in my network or my router settings.The other devices I've renamed haven't changed their names in pi-hole too, even a reboot did'nt helped...  
So where does the names come from? 🤔

---

<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:** [February 24, 2020, 2:43pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/7 "2020-02-24T14:43:47Z")

</div>

> [@AFArmyII](#):
>
> So where does the names come from? 🤔

There may be multiple names associated with a single device, and a client may chose to construct a name for itself, with our without considering name relevant values supplied by your router or ISP (happens e.g. when using IPv6, resulting e.g. in names containing `dip0.t-ipconnect.de`).

Your FritzBox provides a list of names when a name is requested for an IP - execute `nslookup 192.168.178.1` on your RPi and see for yourself. I am not aware of a way to make Pi-hole pick a specific name from such a list.

This is also the reason why I personally chose to edit my `hosts` file, as Android devices were listed with ridiculously long and meaningless names like `android-38967b82fa5effbe.local.domain`, instead of the nice clean ones I set in my router 😉

---

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 24, 2020, 2:52pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/8 "2020-02-24T14:52:39Z")

</div>

Okay so how exactly do i edit the hosts file? Just entering it and enter the ip followed by the name, exit the ssh session and reboot the system? And of course give my devices static ips 😉

---

<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:** [February 24, 2020, 2:59pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/9 "2020-02-24T14:59:19Z")

</div>

`sudo nano /etc/hosts` and follow the pattern already in there, i.e. one line for each` <ip-address> <hostname>` association, save on exit and restart Pi-hole's DNS:

```auto
pihole restartdns

```

IP addresses don't have to be strictly static, fixed is enough (as configured by DHCP lease reservation in your FB).

---

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 24, 2020, 3:05pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/10 "2020-02-24T15:05:05Z")

</div>

Okay, so I just enter the Ips make a space and then the name and do this for every device, one per line. Since I've never worked with the dhcp server I'll just use static ips, no disadvantage I think.  
But how exactly do I exit the menu on the ssh client? If I enter "^X" nothing happens...

---

<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:** [February 24, 2020, 3:17pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/11 "2020-02-24T15:17:11Z")

</div>

> [@AFArmyII](#):
>
> Since I’ve never worked with the dhcp server

We are not using a DHCP server on your RPi here, just configuring name resolution.

> [@AFArmyII](#):
>
> I’ll just use static ips, no disadvantage I think.

[details="Sorry, I might have confused you by being overly pedantic on the terms "static" and "fixed" (click for more)"]  
Static IPs have to be configured on each client individually, commonly by editing each client's corresponding network configuration, which implies you can easily access that client's CLI (or equivalent).

Fixed IPs can be centrally configured via a DHCP server (i.e. your FritzBox). A fixed address is still assigned to a client dynamically, but your FB assures that a client always gets the same address by DHCP lease reservation.

Both serve the same purpose, to much the same effect, but fixed IPs are a bit easier to maintain.

Granted, even in IT, these terms are often used interchangeably, even though they differ 😉

* * *

[/details]

> [@AFArmyII](#):
>
> But how exactly do I exit the menu on the ssh client? If I enter “^X” nothing happens…

You mean exiting `nano`?  
"^X" stands for the keys `<Ctrl><X>` pressed simultaneously. `<Ctrl>` may read `<Strg>` on your keyboard (German layout, right?).

---

<div class="post-metadata">

**Author:** ![AFArmyII](https://discourse-cdn.pi-hole.net/letter_avatar_proxy/v4/letter/a/858c86/32.png) [@AFArmyII](https://discourse.pi-hole.net/u/AFArmyII)\
**Post date:** [February 25, 2020, 11:02am UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/12 "2020-02-25T11:02:01Z")

</div>

Alright now Im getting it^^  
The terms "fixed" and "static" are indeed confusing.  
And yes Im using a german key layout. So now I finally know how to work with these commands 😉  
The option for conditional forwarding has to be disabled to prevent trouble right?  
And what does these option anyway? 😃

---

<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:** [February 25, 2020, 2:54pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/13 "2020-02-25T14:54:46Z")

</div>

> [@AFArmyII](#):
>
> The option for conditional forwarding has to be disabled to prevent trouble right?  
> And what does these option anyway?

Enabling or disabling _Conditional Forwarding_ would depend on your exact configuration and on your personal preference.

If you'd just want to handle those misbehaving devices that otherwise would appear with too long/unintelligable a name, you could just add those to `/etc/hosts/` and leave the rest to your router. I'd prefer that if I had a large number of hosts with very few misbehaving devices, but in your case, going the full way is maybe what you want anyway, as that's the only way to get rid of the 'fritz.box' domain suffix. It's really a question of personal choice.

In general, _Conditional Forwarding_ tells your Pi-hole to ask your router (or more precisely: an arbitrary device) to provide a name for an IP address that Pi-hole's DNS cannot associate with a name. Also, directly above the option in Pi-hole's UI there's a nice paragraph explaining how it does this and when it should be applied 😉

---

<div class="post-metadata">

**Author:** ![system](https://discourse.pi-hole.net/uploads/default/original/3X/7/c/7c8792f649eeb921c5d2b4c41564ffa873d9a2b8.png) [@system](https://discourse.pi-hole.net/u/system)\
**Post date:** [March 17, 2020, 2:54pm UTC](https://discourse.pi-hole.net/t/how-to-show-readable-hostnames-when-conditional-forwarding-supplies-only-gobbledygook/28668/14 "2020-03-17T14:54:50Z")

</div>

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
