IP is not resolving while doing nslookup

Fahrid F 191 Reputation points
2020-12-11T10:20:21.5+00:00

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 Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,348 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
11,935 questions
Windows DHCP
Windows DHCP
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.DHCP: Dynamic Host Configuration Protocol (DHCP). A communications protocol that lets network administrators manage centrally and automate the assignment of Internet Protocol (IP) addresses in an organization's network.
1,020 questions
Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,701 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sunny Qi 10,881 Reputation points Microsoft Vendor
    2020-12-14T03:57:25.42+00:00

    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.


2 additional answers

Sort by: Most helpful
  1. Vadims Podāns 8,861 Reputation points MVP
    2020-12-11T10:58:57.327+00:00

    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).

    0 comments No comments

  2. Fahrid F 191 Reputation points
    2020-12-15T06:09:47.427+00:00