How to make nslookup work on Windows

When I needed to look up a hostname on Window I kept trying nslookup, but it gave the wrong result every time. I would login to a Linux box, run host, and be done with it. But I finally got fed up with not knowing why it didn’t work on Windows, so I researched the issue.

It turns out nslookup is more than just a command line utility – it’s a shell. Running nslookup will drop you to a shell where you can look up hostnames to your heart’s delight. But it still gave the wrong “Non-authoritative” result.

The solution? Add a period (.) after the hostname, hearkening back to the days of editing /etc/named.conf where a trailing period could mean the difference between a domain functioning properly and utter chaos.

Apparently nslookup on Unix and Linux requires the trailing period as well, but I’ve always used host and dig so I didn’t know.

In short, if nslookup isn’t working, throw a dot on the end.

Comments are closed