Easy way to dump nameserver settings for all hosted domains??

lbeachmike

Well-Known Member
Dec 27, 2001
306
1
316
Long Beach, NY
cPanel Access Level
Root Administrator
Hey there -

Does anybody know of any easy way to effectively do a whois to show the nameservers for every domain on a server?

I already use the Account DNS Check plug-in from NDC Host, which is great - however, I am not looking to see what resolves to the server, but actually via what specific nameservers it each domain is using.

The scenario is one in which multiple domains with different nameservers over many years were used to point to a particular server. We want to filter those who are using an older domain for their NS so we can discontinue that domain.

Thanks.

Mike
 

DanS.

Member
Sep 6, 2011
13
0
126
cPanel Access Level
Root Administrator
Hello,

I believe that the linux command line utility "dig" would be the easiest way to accomplish this. At the command line simply type "dig ns <domain.tld> +short". Replace <domain.tld> with the domain name in question. That will output the name servers for the domain.
 

lbeachmike

Well-Known Member
Dec 27, 2001
306
1
316
Long Beach, NY
cPanel Access Level
Root Administrator
Hello,

I believe that the linux command line utility "dig" would be the easiest way to accomplish this. At the command line simply type "dig ns <domain.tld> +short". Replace <domain.tld> with the domain name in question. That will output the name servers for the domain.
Thanks. Though, that would only dump one. I'd need to script a loop to dump them all. Although I could likely figure out the scripting portion, where would be best to pull in the list of all domains on the server from? (Including parked and add-on)

I'm wondering if there is already something like this scripted.

Thanks.

Mike
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Just to clarify, you want the nameservers at the domain registrar level or the DNS zone level, since those can differ? If you want the whois entries at the registrar, this would be a different command you'd need to use.
 

lbeachmike

Well-Known Member
Dec 27, 2001
306
1
316
Long Beach, NY
cPanel Access Level
Root Administrator
Just to clarify, you want the nameservers at the domain registrar level or the DNS zone level, since those can differ? If you want the whois entries at the registrar, this would be a different command you'd need to use.
Domain level.

I want to make sure that all client domains are using our most current nameservers.

If there are users that have their domain set to point to ns1.old.com, ns2.old.com, I'd want to be able to scan the server to find that fact so we can update their domains accordingly.

This would be useful if an old domain was not going to be renewed, or with a business acquisition that requires nameserver transitions where one might not ultimately have control of the original domain name supporting the nameservers that originally pointed to a particular server.

Example -

I acquire clients from a business which has nameservers ns1/2.theirbusinessname.com and ns1/2.servername.com both in use pointing to the server.

Most client domains are using ns1/2.servername.com, but a few are using ns1/2.theirbusinessname.com.

I am unable to acquire their domain name, theirbusinessname.com.

I would not want to have clients who are still using those nameserver settings because if the original business decided at some point to use ns1/2.theirbusinessname.com for something else, or to let it expire, you'd have clients with domains no longer pointing to the server.

I hope this is much clearer.

Thanks.

mrk
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
By domain level do you mean domain registrar level, since domain level could be DNS zone level depending on meaning. That's why I used specific terminology.

If you mean domain registrar level, then the issue becomes that different registrars indicate nameservers differently. For example, at GoDaddy, it has:

Domain servers in listed order:
NS1.TRISTANWALLACE.COM
NS2.TRISTANWALLACE.COM
If NS weren't in the nameserver names, you couldn't query using a grep to get those records. You'd have to pull the full whois information. There is simply no scripted tool that I know which provides this information.
 

lbeachmike

Well-Known Member
Dec 27, 2001
306
1
316
Long Beach, NY
cPanel Access Level
Root Administrator
I'm sorry - yes - I am referring to the domain registrar level. Hence the challenge. Although I suppose I should check the server DNS level for the same, but that is easy.

I figure that with all of the domain tool sites out there, somebody must have something running to do this.

Thanks.

mrk
 

lbeachmike

Well-Known Member
Dec 27, 2001
306
1
316
Long Beach, NY
cPanel Access Level
Root Administrator
Excellent! Very much appreciated. It looks like this does the opposite of what I want to accomplish, but it would accomplish the task indirectly.

Only 20 bucks for the one nameserver I checked on, so not too bad.

Here is the URL for anybody else who stumbles upon this thread and is interested -

Name Server Report | Domains on a Name Server | DomainTools

Thanks.

Mike