Nslookup not using hosts file
17,916
nslookup
does NOT use hosts
file but DNS.
Try using ping
instead and it will return the IP provided in your hosts
file.
Setup the ip for this domain in a real DNS Server.
Related videos on Youtube
Author by
ajsdg
Updated on September 18, 2022Comments
-
ajsdg almost 2 years
So I've set public IP on the hosts file for a certain public IP address, but it picks up private ip from nowhere or from DNS.
Content of windows hosts file C:\Windows\System32\drivers\etc\Hosts 210.210.210.10 my.domain.com nslookup my.domain.com 10.10.10.10 10.10.10.11 10.10.10.12
I want it to resolve to Public IP i assigned in the file, instead of the private IP it shows when I lookup my.publicdomain.com.
Anyway to fix this? Has anyone experienced such issue? ipconfig /flushdns does not help. Just saying.
-
ajsdg about 9 yearsand then the Nslookup will work? I'm gonna try setting up a dns record for the IP and the host.
-
Efren over 2 yearsThis post says something confusing about the statement, as it says "The DNS server does not use its own local HOSTS file. It's only used by the local client side resolver that is trying to resolve the name you're pinging or using nslookup, etc, " Does this contradict the
nslookup
statement?