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

   nslookup my.domain.com

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.


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.

  • and then the Nslookup will work? I'm gonna try setting up a dns record for the IP and the host. – ajsdg Jun 10 '15 at 18:58
  • how to set 3 IP for the same domain name? – ajsdg Jun 10 '15 at 19:02
  • If you set up this IP for that domain in your DNS Server then nslookup will return what you expect. To setup 3 IP for the same domain you can use three A records in your DNS. – krisFR Jun 10 '15 at 19:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.