Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


timmmay

20575 posts

Uber Geek

Trusted
Lifetime subscriber

#312113 18-Mar-2024 20:22
Send private message

I've just run into and solved a problem based on this difference. Basically I had an old line in my hosts file that meant I couldn't resolve two domains, so when I changed hosting for PiHole / Home Assistant from a server on one IP to a server on another IP it took me two days to work out what was going wrong.

 

I had my server on 192.168.1.42, but I turned that server off and moved it to 192.168.1.12. For some reason I had this entry in my hosts file

 

192.168.1.42 homeassistant.local

 

When I issued an nslookup it returned what I expected to see

 

nslookup homeassistant.local

 

> 192.168.1.12

 

Whereas when I issued a ping command I saw the truth

 

ping homeassistant.local

 

> 192.168.1.42

 

Ping returns the actual IP that Windows is going to send the request to, whereas nslookup looks up the domain from your DNS server. Therefore if you have defined anything in your hosts file nslookup can't see it, but ping can.

 

Two days it took me to work this out. Well, about 3 hours over two days, but still frustrating!


Create new topic

This is a filtered page: currently showing replies marked as answers. Click here to see full discussion.

snj

snj
185 posts

Master Geek


  #3207785 18-Mar-2024 23:16
Send private message

muppet:

 

Seems like a bug with ping - why doesn't it follow the same name resolution path?

 

 

Not a bug actually, just a confusing thing with Windows, especially due to people that say nslookup is the equivalent of *nix 'host'.

 

nslookup is specifically a tool to query a DNS server, (basically the Windows equivalent to bind's dig and so on), so doesn't rely on the host's resolution configuration, except to retrieve the default DNS server addresses.

 

ping refers to the OS's resolution functions which includes the hosts file and so forth.

 

From what I can tell there isn't a Windows equivalent of the *nix host command. 


Create new topic





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.