[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I list all the DNS records for a domain?

Posted on 2006-05-03
37
Medium Priority
?
103,559 Views
Last Modified: 2013-12-23
is there a way I can get a list of all the dns records (A, CNAME, MX, etc) associated with a domain?

I tried using nslookup, then "list mydomain.com" but nothing. I know there must be some simple command either in Win or Unix that will allow me to do this.

Thanks
0
Comment
Question by:javajoe74
  • 6
  • 6
  • 6
  • +7
33 Comments
 
LVL 43

Accepted Solution

by:
ravenpl earned 1000 total points
ID: 16597781
First of all, the DNS server have to allow for listing entries, and or security reasons it usually allows that only to dns slaves (and slaves for noone).
host -al domain.tld dns.server.for.domain.tld
0
 
LVL 2

Expert Comment

by:patspam
ID: 16601892
Or alternatively, if you can running the DNS server yourself in BIND examine the dns files, usually located in /etc/namedb
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16603184
Or another alternative: puth that IP into /etc/hosts
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
LVL 62

Expert Comment

by:gheist
ID: 16610079
> is there a way

do as many DNS lookups as types of records.

Each DNS server returns different data under ANY class of DNS request.

There is no command on UNIX, nor in Windows.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 16620144
is there a way I can get a list of all the dns records (A, CNAME, MX, etc) associated with a domain?

there are two possible ways to understand your question:
1) How to list all records below some domain name.
Usually it's done from interactive nslookup mode, not from batch mode
nslookup - your_dns_server
>set q=any
>ls -d domain.name
listing  may be prohibited by administrator or by firewall settings, in that case you get empty output or 'not implenented' errors.

2) How to get all records of the domain name itself.
in that case you need to run
on Windows:
nslookup -"set q=all" yourdomain.com
onUnix:
nslookup -q=any yourdomain.com

0
 
LVL 27

Expert Comment

by:Nopius
ID: 16620152
and I aggree with gheist, 'set=query=ANY' may be unreliable if run against different servers.

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16622504
>  is there a way I can get a list of all the dns records
use ls command in nslookup, if that does not return the list you have to ask the admin of the DNS server
anything else is guessing
0
 
LVL 8

Expert Comment

by:hiteshgupta1
ID: 16655781
>> there must be some simple command either in Win or Unix
at least not in UNIX
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16655814
what about mentioned in very first comment
host -al domain.tld dns.server.for.domain.tld
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 16671313
>There is no command on UNIX

>> there must be some simple command either in Win or Unix
>at least not in UNIX

Stop saying that!  It's simply not true.

Of course there is a simple command, given that the remote DNS server that hosts the zone is willing to transfer the zone to you - it's:

dig @primary-nameserver.example.com example.com axfr

Which effectively downloads the zone as if you were a secondary nameserver.

Cheers,
-Jon
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16675002
as Jon and I (see http:#16622504 )said, the DNS server has to allow a listing
then nslookup, dig, some others kan list the domain on any OS and on windoze
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 16675008
OK, now I'm feeling ignored (see my very first comment).
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16675116
oops, host is a valid solution on some Unix' too
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 16677051
yup, raven deserves some serious credit here (I was not aware of such a usage for the 'host' command - it still seems overly verbose compared to the similar dig command).

My apologies to raven,
-Jon

0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 17249452
Try this:
# dig mydomain.com axfr
As already said, access restriction may apply.

If you don't have dig on your Unix box you'll have to get it from the different sources (tell me which Unix brand you have and I'll point you to the correct location).
For Solaris (SPARC or x86) this would be http://www.sunfreeware.com (make sure to use your closest mirror).
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 17254980
JustUNIX - thanks for duplicating my advice without giving credit.

Cheers,
-Jon
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 17261774
Sorry Jon,

I've not seen you posting (maybe, I was too much in a hurry that day :-(    )
You're right, the only difference ist, that you also specified a specific name server and I did not.

I apologize!

Cheers,
Hanno
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17666321
I think I addressed two major things in my very first comment: Usually You can't, and if You can host -a -l will do.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17666486
agreed, ravenpl said it all in his first suggestion
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 17674771
agreed
0
 
LVL 62

Expert Comment

by:gheist
ID: 17691042
I agree that first answer answers everything others just sched some light on non-impostant detail.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 17746262
Vanbili,

a) the problem is that the command "host" (suggested by ravenpl) is not usually available.
b) nslookup is always available (as Nopius sugegsted) -- but not always reliable.
c) Using "dig" (The--Captain) would be the best (but some Unix variants don't have it either :-(  )

Therefore, all three contributed to the solution in different ways ...
0
 
LVL 20

Expert Comment

by:Venabili
ID: 17746297
JustUNIX,

Where you had been last 2 weeks when 4 experts made a recommendation what to happen with the question and all of them agreed?
However - I stand behind my recommendation.

On a very side note: You posted in this question for the first time 3 MONTHS after all the discussion had stopped. I am not quite sure if anyone needs a solution 3 months later. Had it not been the slip in cleanup, this would had been closed by this time.

Maybe you can try to answer to questions AND pings in time? You may find that the Askers actually return if you post when they need help.

PS: And if you cannot type a simple name as Venabili, just copy it. It does not take so much time.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17746895
> Where you had been last 2 weeks ..
hey, Venabili sometimes there's more to do than EE :-))

nslookup is the most reliable suggestion 'cause available on all platforms (at least I don't know any which misses ls command there, including M$), but host is available on most modern platforms too.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 17746935
JustUNIX is little right in fact: nslookup is dropped from modern OSes. In fact same for host. Dig replaces both of them - but on the other hand dig is rather new tool and not available on older systems.
Split between those who first mentioned each of those commands.
0
 
LVL 20

Expert Comment

by:Venabili
ID: 17747380
>>hey, Venabili sometimes there's more to do than EE :-))

ahoffmann,

It was not for you :) And why I hear this line always less than an hour after my comment and always from people that had been not answering for days/weeks/months and had just realised they do not take points? Nothing personal - just observation... :) Kind of strange, isn't it? :) And actually you DID agree to the award to ravenpl?

ravenpl,
I would agree for the dig but it was ahoffmann who mentioned it. JustUNIX came too late and did not really added new information...
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 17747485
As you see before, I did never say I deserve points for answering -- as three others contributed earlier.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 17747580
most of the thread goes about "who's right" or "who was first" and no experts insist on being the most correct, as usual ...
Venabili, you got all the information, make your descission.
If totally unsure, ask the PE here, who will vote for a split now, I'm pretty sure ;-)
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 17751823
>I would agree for the dig but it was ahoffmann who mentioned it

No, it was The--Captain that mentioned it

>If totally unsure, ask the PE here, who will vote for a split now, I'm pretty sure ;-)

As long as we can arrive at a consensus, I don't care what happens.  IMO, the bottom line is that there exist cmdline solutions for zone transfers, and raven pointed that out first.

Cheers,
-Jon
0
 
LVL 20

Expert Comment

by:Venabili
ID: 17755566
Guys,

I asked what to recommend. 4 of you said "award ravenpl" (including the PE). I decided to agree with the 4 of you . And now we have all this again... This is what really confuses me - if it wasa direct recommendation, I would most probably be back reading and reading again but after a ping and supposedly agreeance of everyone?
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 17755612
OK -- to finish this up:

ravenpl pointed out that there is a cmd available (host). So he deserves the points.

I only wanted to add that there is more than this and it will not help in many cases ...
Sometimes, Unix has many different ways to offer for sultions -- and the many variants
(including a whole vast of Linuxes) add to this.
0
 
LVL 16

Expert Comment

by:The--Captain
ID: 18400809
I agree - pts to raven

Cheers,
-Jon
0
 

Expert Comment

by:percuno
ID: 25753208
Given that this thread is 2/3 years old, I am finding it hard to reconcile the comment by ravenpl  that nslookup and host have been "dropped" by most modern OSes. Can you clarify on this ravenpl?

I use Windows XP, Vista and 7, RHEL 5.3, Fedora 11, and Ubuntu 9.x, as well as an older Fedora 4 box that is soon to be obsoleted, which pretty much covers* the range of commonly** used modern OSes, and every one of them still have both commands. I agree that dig is better, but doesn't exist on Windows of any flavour that I am aware of, and sometimes you don't need all of that information anyway. When it is needed, it is a godsend.

* given that RHEL/Fedora/CentOS and Debian/Ubuntu are the most prolific major branches of Linux

** as in many tens of thousands of users or more.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Make the most of your online learning experience.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question