// Tutorial //

DNS Tips and Tricks

Published on September 10, 2012
Default avatar
By Etel Sverdlov
Developer and author at DigitalOcean.
DNS Tips and Tricks

How to Confirm your DNS records are working using WHOIS and Dig

After you have pointed your domain to the DigitalOcean name servers, you might see that pinging it still displays the old information.

This may occur because the old DNS information has not had a chance to propagate. For example, your home internet provider will cache the DNS information for a designated amount of time known as TTL (Time To Live) and will provide only that information until it expires. The time to live is commonly set to half an hour.

You can verify that you are using the DigitalOcean name servers by running WHOIS; the output should include the most current name servers information:

whois yourdomainname.com
Domain Name: YOURDOMAINNAME.COM
   Registrar: ENOM, INC.
   Whois Server: whois.enom.com
   Referral URL: http://www.enom.com
   Name Server: NS1.DIGITALOCEAN.COM
   Name Server: NS2.DIGITALOCEAN.COM
   Name Server: NS3.DIGITALOCEAN.COM
   Status: ok

After checking that the WHOIS information has been correctly updated, you can use dig to verify that the DigitalOcean name servers are serving DNS records for your domain name.


dig -t NS yourdomainname.com @ns1.digitalocean.com

; <<>> DiG 9.7.3-P3 <<>> yourdomainname.com ns
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62068
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;yourdomainname.com.		IN	NS

;; ANSWER SECTION:
yourdomainname.com.	7200	IN	NS	ns3.digitalocean.com.
yourdomainname.com.	7200	IN	NS	ns2.digitalocean.com.
yourdomainname.com.	7200	IN	NS	ns1.digitalocean.com.

;; Query time: 47 msec
;; SERVER: 192.168.56.1#53(192.168.56.1)
;; WHEN: Mon Sep 10 17:44:49 2012
;; MSG SIZE  rcvd: 101

All of this information is useful as it provides the fastest way to confirm that your site is connected to the correct name servers and that the information is propagating while your site is updating.

How to Set Up DNS Load Balancing

DNS records can provide a way of building a simple load balancer to distribute site visitors across several IP addresses, each one serving identical content. If more than one IP address is connected to a site, visitors will be sent to one of the connected IP addresses in order. Although this is a helpful way to serve more visitors and prevent the site from going down if one server fails, DNS load balancing remains a very simple algorithm that does not account for geography, network congestions, or user IP address (among others).

To setup DNS Load balancing fill out the site’s A records with @ in the hostname, directing users to the main domain, and with the correct IP in the IP Address field. Your set up should look something like this:

<img src=“https://assets.digitalocean.com/articles/dns_tips_and_tricks/round_robin.png” alt=“dns”

How To Change Name Servers Without Site Downtime

When changing your site’s nameservers from your current host to DigitalOcean, you can do so without any site downtime.

Start by setting up all of your DNS settings in the DigitalOcean interface. Doing this will have no effect on your current website because the site has been configured on the original host.

Once you put in your A, CNAME, and MX server records, access your domain registrar. If you do not remember where you registered your name, you can look it up using “WHOIS”, a protocol that displays a site's identifying information, such as the IP address and registration details.

Open up the command line and type:

whois example.com

The command will display all of the details associated with the site, including the Technical Contact which contains your domain registrar.

Once you have the information, you can change the nameservers to point to DigitalOcean (ns1.digitalocean.com, ns2.digitalocean.com, ns3.digitalocean.com), and the website will be transferred over with no downtime.

By Etel Sverdlov

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in our Questions & Answers section, find tutorials and tools that will help you grow as a developer and scale your project or business, and subscribe to topics of interest.

Sign up
About the authors
Default avatar
Developer and author at DigitalOcean.

Still looking for an answer?

Was this helpful?
10 Comments

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

DNS is free

When using the dig command, how do I check in the feedback that I receive if the DigitalOcean nameservers are actually serving the domain?

For example, in my feedback, I get back the following warning:

;; WARNING: recursion requested but not available

When using WHOIS with my domain, I get the following message: “The number of requests per client per time interval is restricted. You have exceeded this limit. Please wait a moment and try again.”

Can you help me please?

How long does it take until the changes are in effect?

My domain name is “amitbatajoo.com.np”. I’ve created an A record that forwards to the IP address of the droplet but when I ping or whois it doesn’t resolve to a host.

Thank you!

Hi, I’m new to this kind of infrastructure and operations stuff. I already confirmed that my DNS records are working using whois and dig. But I guess that I’m missing something, because when I try to access some resource of my website (i.e http://mysite.com/helloworld), the URL changes and misses the name and changes it to the IP number --> http://111.111.111.111/helloworld) What kind of configuration must I do to fix this? Any help will be well received Thks

@tony, unfortunately I don’t think its possible to adjust the TTL.

Guys my idea is put all my structure into a droplet at DigitalOcean. I have 3 sites all pointing to different hosts. I create my droplet here with LAMP + phpMyAdmin+VSFTP+virtualmin and webmin. The first (top-server) work flawless after i update the DNS at DigitalOcean panel. The other two subdomains i created at webmin with FTP, Email access simply doesnt work. After reading all you post about DNS i cant figure how to solve this. May I put the DNS of digital ocean pointing to this droplet or configure my DNS details in Virtualmin? Which one is the correct way to make things work?

I created at Digital Domain DNS area principalserver.com www.principalserver.com dns1.principalserver.com dns2.principalserver.com

Than I put master and slave servers to my two subdomains at virtualmin subdom1.com / dns1.principalserver.com + dns2.principalserver.com subdom2.com / dns1.principalserver.com + dns2.principalserver.com

How can I change the TTL for quicker propagation at DO?