DNS configuration


Introduction

_images/guides-dns-configuration-graph.png

The Domain Name System (DNS) is a hierarchical distributed naming system for computers, services, or any resource connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. Most prominently, it translates easily memorized domain names to the numerical IP addresses needed for the purpose of computer services and devices worldwide. The Domain Name System is an essential component of the functionality of the Internet.

Wikipedia

Using an external DNS server

If your registrar provides you a DNS server for your domain, you can simply use their interface to set a “A record” pointing to your server IP and your domain will be effectively pointed to your server.

The procedures and interfaces to configure the A record are different from one registrar to another. Please consult your registrar documentation or ask their support about how to configure your A records.

An efficient way to find out that information is simply to search on the web something along this line: “How to configure A records on YOUR-REGISTRAR-NAME

Using your own DNS server

This is the procedure to host your domain on your own DNS server. The rest of this tutorial will use these values as example, you should change them according to your informations:

DOMAIN:mydomain.com
SERVER_HOST:ns0000000.ip-1-2-3.net
SERVER_IP:9.9.9.9
DNS_SERVER:ns1.mydomain.com

First create a glue record (a pair of NS and A records) at your registrar (the specific instructions and procedures to do this vary with each registrar).

The glue record is essentially a couple of DNS records (NS and A records) binding the domain mydomain.com to your the primary zone of your DNS server ns1.mydomain.com and to the secondary DNS zone in sdns1.ovh.ca (OVH’s secondary DNS server).

For instance:

mydomain.com NS ns1.mydomain.com
mydomain.com NS sdns1.ovh.ca
ns1.mydomain.com A 9.9.9.9
sdns1.ovh.ca A 8.33.137.137

Once the glue record is created, you must do the same in the main DNS zone of your DNS server.

Only then you should create a secondary DNS zone in sdns1.ovh.ca like so:

  1. Connect to you OVH manager
  2. Select your server and navigate to the secondary DNS section
  3. Add domain mydomain.com and IP address 9.9.9.9
  4. You will be provided a secret token that you must add as TXT record of your DNS zone
  5. The interface will validate that you are the owner of the domain and complete the configuration

Using this configuration, you can take advantage of a free secondary DNS server provided by OVH which will host a slave zone of your domain.

This secondary DNS server works as a backup of your main DNS server.

Note

You need to authorize zone transfers in your server towards OVH’s secondary DNS server. It is very important that you only authorize trusted DNS servers. Here’s an example with BIND (/etc/named.conf):

acl trusted-servers  {
    9.9.9.9;        // ns1.mydomain.com
    8.33.137.137;   // sdns1.ovh.ca
};
zone mydomain.com  {
    type master;
    file "zones/mydomain.com";
    allow-transfer { trusted-servers; };
};

Once configured, don’t forget to restart BIND:

/etc/init.d/named restart