Help (again...) with local name resolution


#1

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

Expected Behaviour:

I should be able to resolve local names

Actual Behaviour:

I get “could not find host” errors

Debug Token:

lk8edlxfbx

I started this effort a few months ago, but was stymied because my previous router insisted on being the DHCP server. But now I have a new router, with DHCP off, so pi-hole is functioning as my DHCP.

Back then, someone told me “local” was problematic as the local domain name, so today I tried changing the setting in pi-hole. And maybe I have this wrong from the beginning. But what I have done is to change the text in the Settings/DHCP/Pi-hole domain name field from “local” to “home” but on (for instance) a Windows laptop, my ipconfig settings are telling me that my “Connection-specific DNS Suffix” is “local”

Now, I have told the pi-hole to restart dnsmasq, I’ve restarted the pi-hole, and I’ve renewed my IP address lease on my laptop. But nothing seems to change the “local” domain suffix to “home” and I begin to wonder if it’s stored somewhere else that isn’t getting updated.

Another problem I had run into (and solved!) was that my router’s IP address had changed in the final octet, and I needed to go modify /etc/dhcpcd.conf by hand to update the address of the router. Certainly thru the GUI I could change what address DHCP was handing out to clients for the gateway, but I couldn’t find a way to change what the pi-hole itself was using for a gateway.

(off, topic, I know, but that was a bit challenging to troubleshoot, because clients couldn’t resolve anything, but the pi-hole log showed all the queries, and suggested they were being forwarded on, and didn’t show any errors…)

So is it possible that this setting, when made thru the GUI, isn’t being reflected in what DHCP hands out to queryers?


#2

I think you are looking for this setting :

Pi-Hole can’t change it for you as far as I know ?!


#3

This is correct.

This is wrong.

To exclude that the problem is with the windows device (not accepting what the Pi-hole transmits (goes into the same direction @nero355 mentioned), can you bring another device into your network that wasn’t in there before and check if it also gets the wrong “local” suffix?

No, that does work as expected and I can, for instance, query “laptop.lan” whereas I have set lan as my domain name on the Pi-hole’s settings page. On my laptop (Linux), I also get the correctly set hostname:

$ hostname -A
laptop.lan

#4

Thanks, folks. I changed it again from home to lan and reconnected my laptop to the network, with no change. Then rebooted a raspberry pi, but hostname -A returns campi.local instead of campi.lan so I am still having no success. I don’t have a computer handy that has no history on the network, though.

Any other ideas?


#5

Have You tried following commands on You Windows computer:

ipconfig /release
ipconfig /flushdns
ipconfig /renew 

Just to force clearing DNS cache entirely.


#6

Thanks for the idea. I will try when I get home.


#7

I forgot the “new” option “registerdns”
It doesn’t harm to add that, it forces the re-registration of all DNS names.

N.B: If You are using IPv6 You might need to use “/release6” and “/renew6” as well.

ipconfig /release
ipconfig /flushdns
ipconfig /renew
ipconfig /registerdns

#8

Sigh… Thanks for the ideas; it’s still saying “local” No IPv6 on my network.


#9

Try the following to see if it is dnsmasq:

dig desktop.lan +short
dig desktop.home +short
dig desktop.local +short

Hint: Replace desktop by something that exists in your local network :slight_smile:


#10

cam@campi:~ $ dig weatherpi.lan +short
cam@campi:~ $ dig weatherpi.local +short
10.10.10.128
cam@campi:~ $ dig weatherpi.home +short
cam@campi:~ $


#11

So this means dnsmasq believes in local being your domain which matches your observations. What is the content of /etc/dnsmasq.d/02-pihole-dhcp.conf ?


#12

Color me surprised, because I was sure it was going to say “local” but instead, it does have the most recent entry I made, based on an article that said the best strategy was to use a subdomain of a domain you own. Here it is:

pi@pihole:~ $ cat /etc/dnsmasq.d/02-pihole-dhcp.conf
###############################################################################
#  DHCP SERVER CONFIG FILE AUTOMATICALLY POPULATED BY PI-HOLE WEB INTERFACE.  #
#            ANY CHANGES MADE TO THIS FILE WILL BE LOST ON CHANGE             #
###############################################################################
dhcp-authoritative
dhcp-range=10.10.10.2,10.10.10.99,4h
dhcp-option=option:router,10.10.10.1
dhcp-leasefile=/etc/pihole/dhcp.leases
#quiet-dhcp

domain=home.tastewar.com

BTW, the pi-hole dashboard shows client names ending in .local as well.


#13

What happens if you change the line

to
domain=dododomain
and run
sudo pihole restartdns
afterwards?

The device should now be found under dig weatherpi.dododomain +short


#14

Should, but isn’t:

pi@campi:~ $ dig weatherpi.dododomain +short
pi@campi:~ $

#15

But it still works with weatherpi.local?..


#16

Indeed. Still returns 10.10.10.128

I am sorry. :wink:


#17

Okay, so I need to dive deeper into your network.

You have (at least) two machines:

  • campi
  • weatherpi

Is Pi-hole running on one of the two or on yet another machine? What is the content of
/etc/resolv.conf on the campi machine?


#18

Thanks, DL6ER! There are a bunch of devices on my network!! :slight_smile: pi-hole is running on the machine named, uh, pihole. I’m particularly interested in local name resolution because I have a script that runs on campi that wants to reference weatherpi’s web server.

pi@campi:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain local
nameserver 10.10.10.186
pi@campi:~ $

10.10.10.186 is indeed the ip address of pihole.

On pihole, we have:

pi@pihole:~ $ cat /etc/resolv.conf
# Generated by resolvconf
nameserver 127.0.0.1
pi@pihole:~ $

if that’s of interest.

Router is at 10.10.10.1 FWIW and is not running DHCP or DNS


#19

Um, there we have the wrongdoer. The question is now how it gets there.

I hope

dig weatherpi.dododomain +short

works just fine when run on pihole?


#20

Next clue: nope. returns nothing when run on pihole. However, if I use .local instead on pihole, I get the IP address back…