question

Fahrid95 avatar image
0 Votes"
Fahrid95 asked GaryReynolds commented

IP is not resolving while doing nslookup

Hi

I have removed DNS from my server and I have added the destination host IP in the Hosts file.

After doing NSLOOUP I am getting error as IP is not resolved.

Can someone please help me?

windows-serverwindows-server-2016windows-server-securitywindows-dhcp-dns
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SunnyQi-MSFT avatar image
0 Votes"
SunnyQi-MSFT answered GaryReynolds commented

Hi,

Thanks for posting in Q&A platform.

As Crypt32's answer, the nslookup command does NOT use hosts file but DNS.

If you remove the DNS, you could use ping instead and it will return the IP provided in your hosts file.

If you want to run nslookup command to resolved the IP address, please setup the ip for this domain in a real DNS Server.

Best Regards,
Sunny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I would prefer to know the full consequences of disabling DNS before pursuing it. Ping uses the hosts file already, so there's no benefit to disabling DNS for a ping. The issue will more often be Kerberos, which uses DNS, not the hosts file. How do you fix that?

0 Votes 0 ·

You should ask your own question. When you do, I would recommend that you explain the root problem that you are trying to solve, and maybe a little bit about your environment.

0 Votes 0 ·

Hi @MikeLandis-3713

In the original question, the assumed scenario was they didn't want to use DNS and the preference was to have local name resolution using a host file, and the result of this configuration is that nslookup wouldn't be able to resolve the name. Your comment is true, if the server also is trying to do anything else that relies on DNS i.e. AD or Kerberos, in which case yes those services\capabilities would be broken.

Gary.

0 Votes 0 ·
Crypt32 avatar image
0 Votes"
Crypt32 answered

This is expected behavior. NSLOOKUP do not use hosts file and use only DNS queries. Since you removed DNS, then NSLOOKUP will return you nothing (negative resposne).

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Fahrid95 avatar image
0 Votes"
Fahrid95 answered SunnyQi-MSFT commented

Thanks both @Crypt32 and @SunnyQi-MSFT

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

You're welcome!

0 Votes 0 ·