Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I test a new nameserver before updating the registrar records?

I have configured a set of DNS records at a new DNS provider. The configuration is complex, with load-balancing, SSL, etc, there are things that could go wrong.

I want to test this configuration before changing the namespace records at registrar.

  • Is there any way to locally provide my machine with the new nameserver for the domain?
  • Are there any tools that might help with this?

Please note: I don't want to just update the A records (e.g. in /etc/hosts) - I want to specifically check the nameserver is returning the A and CNAME records.

like image 377
iHiD Avatar asked Jun 01 '12 16:06

iHiD


People also ask

How long does it take for nameserver changes to take effect?

When changing DNS on a domain, it can take up to 24-48 hours for this change to propagate around the Internet. However, in practise this is usually alot less. Once you change your DNS, we recommend not visiting your domain for 2-3 hours and then retrying. You will usually find DNS has updated.

What happens if I change nameservers?

Although it will be invisible to visitors, a change in nameservers will result in a change in the hosting server for the website. The URL that visitors use to access the site may remain exactly the same; however, the website will be hosted on a different computer.


2 Answers

If you're on a *nix system, you should be able to use either nslookup or dig. With both of those commands you can specify what server you would like to query. Simply use your new nameserver as the server. With dig, the query would look something like

dig @<your-nameserver> <hostname-to-look-up>

So, if you wanted to query google's public dns server and ask it about the address www.google.com, you'd use

dig @8.8.8.8 www.google.com

which, amongst other things, would tell you that www.google.com is an alias for www.l.google.com -- and then would give you a bunch of IP address (A records) for that name.

like image 105
Jonathan Avatar answered Oct 31 '22 06:10

Jonathan


For both Windows and my remote Linux(CentOS) servers I use nslookup tool which works on both platforms:

nslookup new-sub.domain.com 8.8.8.8
// and for more details:
nslookup -debug new-sub.domain.com 8.8.8.8
like image 25
Mojtaba Rezaeian Avatar answered Oct 31 '22 07:10

Mojtaba Rezaeian