Trying to understand/fix local name resolution

The issue I am facing:
Local name resolution does not work. i.e. I cannot resolve "office.lan" (or whatever) to the desired local IP address.

Details about my system:

  • Pi-hole v5.1.2, freshly installed.
  • Netgear Orbi router (yes, I know), however ...
  • Pi-hole is configured to serve DHCP (and DHCP is disabled on Orbi)
  • Ad blocking appears to be working.

What I have changed since installing Pi-hole:

  • Under Settings -> DHCP, I have configured several static leases.
    e.g. A given mac address is leased an IP address of 192.168.1.201 with hostname "OFFICE."

So here's the deal ...

Since the pi-hole is serving DHCP, all clients show up by hostname, not by IP. That's expected. Likewise, the hostname that's showing up is the hostname associated with the device on the Settings -> DCHP page. (i.e. If I gave it a static lease with a hostname, it uses that. If not, it uses whatever host name the device itself reports.)

However, given the static DHCP lease example above, I expected to be able to do a ping or nslookup on office.lan and be directed to 192.168.1.201. Suffice to say, I cannot.

I have also tried adding a "local DNS record" with domain = "office.lan" and IP Address = 192.168.1.201. That doesn't work either.

On the off chance that the ".lan" in the local DNS record might conflict with the "pi-hole domain name" of ".lan" assigned on the DHCP page, I deleted the prior local DNS record and tried assigning the same IP address to "office.foo", but that didn't work either.

I should also mention that I flush the client device's DNS cache and restart dns on the pi-hole after each change. Perhaps that's overkill, but I figured it couldn't hurt.

This YouTube video appears to show a working solution, but this also does not work for me.

To be clear, the goal is for two things to be working:

  1. "office.lan" is correctly identified with that hostname, not by IP address, on the pi-hole dashboard. (working)
  2. All devices on the local network can resolve "office.lan" to its assigned IP address (not working)

What's the most user-friendly way of accomplishing that?

Thanks.

You are correctly assuming that office and office.lan are two distinct hostnames, .i.e. they could well be associated with different IP addresses. So if you do not configure DNS records for office.lan, Pi-hole wouldn't be able to resolve it.

This also means your approach of defining a Local DNS Record entry should have worked. If it didn't, something interferes with DNS resolution.

Could you provide both results for the following command, run from (a) your Pi-hole machine and (b) a client in your network ?

nslookup office.lan

Inexplicably, the names defined in custom DNS records began working this morning when queried from the pi-hole machine and everything BUT my Windows 10 machine.

Somewhat more explicably (and embarrassing) the Windows 10 machine started resolving once I disconnected it from the VPN it had been using the whole time. :persevere:

I've since backed up the pi-hole with teleporter and reinstalled/restored it to a freshly installed pi ... and things seem to be working.

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