I have the Windows Subsystem for Linux (WSL, aka, "Bash on Ubuntu on Windows") running on my Windows 10 PC, and I noticed that there's a slight difference in the output I get when I use nslookup in that environment versus a traditional Windows shell (cmd.exe or PowerShell). Specifically, it's regarding the name server that is used by default to perform the query. So if I do a simple lookup like so:

nslookup example.com

Both the Windows and Linux versions of the command output two lines of info about the name server (obviously in addition to the DNS info about the domain). In a Windows shell, I get both the IP and the name of the name server:

Server: name.of.name.server
Address: xxx.xxx.xxx.xxx

In WSL, both of those lines in the output contain the name server IP (the name server's name is not output), but the second line appends #53 for some reason:

Server: xxx.xxx.xxx.xxx
Address: xxx.xxx.xxx.xxx#53

It makes no difference if I use the option -query=any, I still can't get the name server's name in Linux. Ditto if I use the dig command:

dig example.com any

Information about the name server is near the bottom of the output, and looks like this:

;; SERVER: xxx.xxx.xxx.xxx#53(xxx.xxx.xxx.xxx)

And again, those x's represent the name server IP, and it's the same IP in parentheses (minus the #53).

I was curious if it might be an issue with WSL, so I SSH'ed into a couple different actual Linux servers. I got basically the same results. Obviously the IP of the name server used for each was different, but curiously, even though these were two completely different servers (one in California, the other in Utah), both had that mysterious #53 in the output.

So I have two questions: what does the #53 mean, and how can I get the name server's name to show in the output like it does in the Windows version of nslookup? Yes, if I copy and paste the name server IP into a separate nslookup command in Linux I get the server's name, but I would like to be able to get that information along with the DNS info of the domain I'm querying in one command. I was wondering if there's some option I'm not aware of in either nslookup or dig that will do that. It's not super critical to be able to do this in Linux, it just would be nice, so I'm not interested in solutions that require writing a script or something complex like that.


53 is the port number, standard for DNS queries, so it is simply showing you the IP address and the port.

In regard to the name server, I am at home at the moment so my default name server is my router. Under linux that does indeed report as an IP address but I think that the Windows version of nslookup may use WINS to return a name if available since mine returns as the very odd home.gateway.home.gateway

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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