Joshua
Joshua

Reputation: 1963

Checking Nameserver setup from command line

Is there a way to check if my domain is setup correctly on the nameservers? Ideally I'd like to run a command from command line, alternatively can use a third party tool.

for example, I'm trying to register a domain that's to be hosted on godaddy.com. I have set up the domain and can see it in my DNS list. The servers that are supposed to be setup are ns51.domaincontrol.com and ns52.domaincontrol.com, however my registration is bouncing saying that there are "No Nameservers found for {my new domain}".

Upvotes: 20

Views: 22629

Answers (5)

Mauvis Ledford
Mauvis Ledford

Reputation: 42344

If you're on a Mac or Unix machine you can do the following from command line:

whois site.com

Toward the end it should give you a list of DNS servers.

You can filter the list, showing only the Name Server information, with:

whois site.com | grep "Name S"

Note that www.site.com and site.com are two different end points and you need to set up appropriately for both of them.

Upvotes: 18

Jesús Carrera
Jesús Carrera

Reputation: 11425

I think this is the shortest and quickest command to list your nameservers:

host -t ns yourdomain.com

Upvotes: 45

Valer
Valer

Reputation: 51

There is a built-in command line for that: nslookup

Submit it, then write set type=ANY and press enter. After which specify desired domain and you'll get what you are looking for. Alternatively, enter ? and see more options for the nslookup command line.

PS: while this answer comes with a delay, hope it to be useful for others who want to check nameserver/DNS setup from command line.

Upvotes: 4

user3531645
user3531645

Reputation: 1

nm-tool run from the command line will give you much information, not the least of which is the DNS servers you're using. You may have to install this, but many distros have it included.

Upvotes: 0

bortzmeyer
bortzmeyer

Reputation: 35459

Zonecheck is a free software and can be run from the command line:

% zonecheck stackoverflow.com
ZONE  : stackoverflow.com.
NS <= : ns51.domaincontrol.com. [216.69.185.26]
NS    : ns52.domaincontrol.com. [208.109.255.26]

       _______________
     ,---------------.|
~~~~ |    warning    || ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     `---------------'
w> Nameservers are all part of the same AS
 | Adv: ZoneCheck
 |   To avoid loosing all connectivity with the authoritative DNS in case
 | of a routing problem inside your Autonomous System, it is advised to
 | host the DNS on different AS.
 `----- -- -- - -  -
 :   All the nameservers are part of the same Autonomous System (AS number
 : 26496), try to have some of them hosted on another AS.
 `..... .. .. . .  .
=> generic

==> SUCCESS (but 1 warning(s))

Upvotes: 5

Related Questions