list all DNS servers

Dear All,

I am looking for a way to list all DNS servers I have and the type of zones inside each server?

Who is Participating?
Andrej PirmanConnect With a Mentor Commented: would be easier with some more details:
- Windows or Linux or Unix DNS?
- how do you mean "...all DNS servers I have"? You mean, you do not know your own dns servers?
- for which domain? Only 1 domain, or many domains?
- is it local domain, Active Directory, or web domain(s)?

Ok, but let's assume you have DNS somewhere hosted and you have your domain registered, and you did not do it yourself. And that you are corius about only 1 domain.

First, let's dig all we can about your domain.
Go to and click on DOMAIN DOSSIER.
Enter your domain name and check all boxes.

If you list results, down under DNS ZONE section you will find interesting data.
What you need is:
IN  NS  records, which tell you all DNS servers, which your domain is registered with
IN  MX  records, which tell you which MAIL server receives mail for your domain

Now, althrough you will see most important data here, you will NOT see all remaining A-records and other records here. For example, there might be a sub-domain "", which is technically most probably A-record (or CNAME record), which is not listed there. You could see it only if you directly query for that sub-domain name.

You would be most probably interested into getting the whole DNS zone for your domain. But the whole DNS zone is most probably hard to retrieve, because zone transfers are most probably "locked" and allowed only between servers, listed as nameservers (IN NS part of zone). So you won't be able to retreive the whole zone in one pass.

So you may play around in Windows with NSLOOKUP command line tool.
Just start CMD command line, and type
You are now inside NSLOOKUP program, and you may retreive zone data.

Try this:
set type=mx

set type=all

You may try with other types (A, MX, NS, CNAME) and learn about your domain.
Hope it helps.
Chris DentPowerShell DeveloperCommented:

You can get a little by pulling the list of holders for ForestDNSZones. "nslookup" will do, you can look at the partition holders list as well. It's not exhaustive though, it will only tell you about 2003+ Domain Controllers running the DNS service.

Beyond that, the only way would be to examine each server for the DNS service; WMI works, but it won't be fast if you have a large number of servers.

Once you have the servers, types of zone can be found using WMI, or by using "dnscmd /EnumZones".

Chris DentPowerShell DeveloperCommented:

The author has a lot of posts in the AD areas about auditing, hence the MS assumptions in my original post :)

Andrej PirmanCommented:
Hence the difference between your and mine answer, since I was "just passing by", looking the question only. Hope we covered any situation he was asking for :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.