Transfer DNS zone

Share it!

In this article I would like to give an example of how to transfer a domain zone from a DNS provider to another. After implementing this change, sounds really easy and simple, but before doing it I was lost in translation. I will try to provide some definitions and simple steps how to perform this task. I will try to keep it simple, as everybody can find all those complex definitions in a single search.

Definitions:

What is DNS:

The domain name server, is a server that keep entries that match a URL to an IP address,

e.g. www.networkfashion.net  -> 10.10.10.10

When a user is typing the URL, the host sends a query to the DNS server asking for the IP address. The DNS responds with the IP and then the host forwards the packet using the IP address in the packet.

What is Name Server:

A name server keeps the zone. The Name Server hosts the zone file. Periodically checks if the file is updated. If not, it retrieves an updated copy from master files stored locally.

What is a Zone:

A zone is a database with the subdomain and domain entries, e.g. email.networkfasion.net

What is SOA (Start of Authority):

The SOA record contains the values.

  • NS
  • An e-mail address
  • Serial Number
  • Refresh timer
  • Retry timer
  • Expire timer
  • TTL

The Domain Name field is to declare the Name Server that is used as primary source for this file. The Serial Number is the number that changes every time that a change has been done to the zone. The Name Servers compare the SN of the record that they hold with the SN of the primary NS. If it is different, it means that the file that they have stored should be updated. The timers are used for synchronization with secondary NSs.

What is Registrar:

The registrar is the company where you register your domain name.

THE CHANGE

After explaining some definitions (in really understandable language to anyone – I hope- ) let’s see an example of how to transfer the domain from one DNS provider to another.

In order to perform a quick change and have the possibility to roll back the change the first step should be to lower the TTL (e.g. 900 seconds) value of the Name Servers configured in the DNS zone.

Then from the DNS provider you can extract the zone and have it in a txt file. In the new DNS provider, create a new primary domain. Upload the zone file. Modify the SOA record. When you create the domain, your DNS provider will provide you with some NS. Add one of them (e.g. the first available) in the SOA record.

As a serial number it is suggested to be in the form yyyymmdd01. This number increases every time a change is performed.

As TTL value you can add a relatively low value as 28800 (in seconds). In this way, you can roll back the change faster. The other timers can be set as one day. The other timers can be set as one day.

Add the NS provided by your provider to the zone. As TTL value you can add a relatively low value as 900 (in seconds). In this way, you can roll back the change faster. When everything is verified, you can modify it to 28800 as well.

Go to your registrar. Under your domain, change the configured NS. It is recommended that in the beginning you have both of the DNS providers’ NS. When you see requests to your new DNS provider and verify that there are no errors, you can remove the old Name Servers.

DIG command:

Some useful commands to check the Name Servers and other related info using the dig command.

#dig <domain>

#dig <domain> NS

Check the Name Servers that are used to reply for this domain

#dig <domain> NS @8.8.8.8

Check the Name Servers that the 8.8.8.8 DNS uses to resolve the name

#dig <domain> NS +trace

Check the path from the root Name Servers

 

Reference:

  1. https://www.ietf.org/rfc/rfc1035.txt
  2. https://tools.ietf.org/html/rfc2181

 


Share it!

notis

I am a network engineer since 2014. My main goal and the purpose of this site is to document whatever I learn so I can explain them better and of course transfer the knowledge in really simple words. Please feel free to contact me or visit my profiles for more information.