Windows PC is displayed with IP instead of hostname

Summoning this old thread back.
Many of my devices are correctly identified as hostname.home but my current windows PC shows up as 192.168.x.x.

if I run cmd and do hostname i get my PC hostname, so I don't understand why it fails.


If I add the hostname on /etc/hosts and restart pihole, then it shows the hostname I have defined (minus .home at the end). I would like all my devices to be automatically identified from the static routes, so that they all automatically become NAME.home

Any idea?

Moved your posting to here bc that other thread/FAQ is a bit outdated I think.
I believe we didnt have the "Conditional Forwarding" setting then which provides a third option.

Three questions:

  1. How are IP details configured on that Windows PC, automatically via DHCP or did you configure static IP details?
  2. Who does DHCP services for your network, the router or Pi-hole?
  3. Is Pi-hole running bare metal or maybe in Docker?

So yeah, after a full day I am somewhat on top of it:

  1. Yup, you probably have already guessed it: all my devices were set manually, definitely a stupid mistake. Because of that they would never send a DHCP request and I assume pihole was then unable to set them up correctly. Putting them back on automatic IP assignment (and restarting them) made it so that pihole would dispense the correct network info.
  2. Pihole does both DNS and DHCP
  3. In Docker

There was something that I didnt understand regarding the pihole UI: I assumed that the first DHCP section was for dynamic leases, and the bottom one was for the static ones. I was finding it really confusing that I'd see my devices in both sections, so I would manually remove them from the top section to keep them only in the static leases. I think this was a mistake on my part, but I think the UI didn't help.

Finally, I still have a minor issue: when I go on Query Logs, many of the Clients still show as IP number, instead of Hostname. I find this a bit annoying as I can clearly see the hostname in the DHCP section. I dont fully understand what is causing this given that some devices show IP and others HOSTNAME.home

I hope this helps, thanks for taking the time to read through all this madness

1 Like

Yeah only hosts that acquire IP details via DHCP will advertise their hostname to the DHCP server.
And Pi-hole will create DNS records for them (A & PTR).

The first section clearly states "Currently active DHCP leases".
Doesnt matter if you configured a static DHCP reservations for a particular host or not.
You might know already, those leases expire after a certain period if not renewed in time (usually 12 or 24 hours).

Wait a bit longer.
Pi-hole updates those hostnames every hour.

Yeah, don't get me wrong, I understand this is me being a noob. I think what confused me was that many connected devices didn't show up on "Currently active DHCP leases". I assume this is because they already knew what network configuration to use, and pihole didn't need to reassign it?

I was actually unaware, so the list will basically empty itself after a while. I guess the point being that without an initial lease, pihole would not be able to read the hostname, and would initially fail to allow hostname.home for that device. Or at least that's my current understanding.