0

While looking into mdns for an IOT device I was making I discovered that on my home network if I typed in hostname.lan, chrome browser would resolve the address to the appropriate local device with that hostname. When I ran nmap to scan for local devices it would also provide this information in the output

Example:

$: nmap -p 80 192.168.0.100

Nmap scan report for hostname.lan (192.168.0.100)
Host is up (0.00031s latency).
PORT   STATE SERVICE
80/tcp open  HTTP

I like this feature, but I am annoyed because it randomly stops for days at a time.

At first, I assumed this was something my router was doing (a TP-link Archer C9) but I have not been able to find a place to enable or disable this setting, nor any documentation about it on the internet. Then I thought maybe it was a program running on a raspberrypi, but have not been able to turn it on and off with any programs from my RPIs. I've spent a lot of time spinning my wheels searching the internet for what program makes the .lan domain, will very little luck.

My question is, how do I figure out who is resolving these addresses. Or in the sad situation where this never returns, how do I setup a DNS server that automatically resolves hostnames to IP addresses on my LAN?

jeffpkamp
  • 121
  • 4
  • 1
    Go to DOS. Type in `nslookup hostname.lan` and you know which DNS server responded https://en.wikipedia.org/wiki/Nslookup – Gantendo Apr 01 '22 at 18:29
  • Are you running PiHole on that RPI? You can enable a DNS server in PiHole. See also https://superuser.com/questions/45789/running-dns-locally-for-home-network and https://www.cloudsavvyit.com/14816/how-to-run-your-own-dns-server-on-your-local-network/ – Gantendo Apr 01 '22 at 18:34
  • 1
    mDNS is a zero-conf networking approach to name resolution, so the client sends a multicast request for a name to the whole LAN, and the station with that name responds, providing its IP, rather than using a centralized server. its likely that your router is using DNSMasq to forward queries up to your ISP DNS server for names that don't end in .local or .lan. check `ipconfig /all` to see what your configured DNS servers are, but I'm guessing it contains your routers IP address. your client will only use the DNS server IP if the name ends in a valid global TLD like .com/.edu/.gov/etc. – Frank Thomas Apr 01 '22 at 19:28
  • I've checked out all of your comments and the DNS is for normal webpage lookups is indeed going through my router, which I knew it was. However, since I've written this, the `.lan` resolution has stopped working :( and so I can't use `nslookup` to find it. Anyone know programs that perform this function? – jeffpkamp Apr 04 '22 at 14:59

0 Answers0