DNS is fundamental to how the Internet works. It is a distributed database of servers which holds domain-related pieces of information called records. Its main function is to map names to IP addresses and respond to queries related to those. Without DNS, it would be error-prone and difficult for humans to connect to anything on the Internet. In this article, we’ll describe the most common DNS records and the piece of information they hold which is related to your domain name.
What are DNS records
DNS records, or resource records as they are properly called, are sets of information that describe a domain name. DNS records are included in data files, called the zone files. These records are what your DNS provider exposes to you so that you can manage your domain.
The Domain Name System is a distributed one, which means that zone files are kept in multiple servers and not just one. Zone files contain a serial number and a TTL number (Time to Live). The serial number indicates the current version of the zone file and is changed (incremented) whenever a change happens in that file. The TTL number indicates the amount in seconds, in which the zone file should be cached by a nameserver. If the TTL expires, then the nameserver will not serve the cached zone file, but it will request the new version from the authoritative nameserver of that domain.
Types of DNS Records
The DNS protocol describes a lot of different records for different purposes but the most commonly used are the following:
The Address (or simply A) record, is probably the most fundamental and widely used. It is the one that maps names to IP addresses. For example, the following record:
yourwebsite.com. IN A 18.104.22.168
will map the domain yourwebsite.com to IP address 22.214.171.124. The IP address is usually given to you by your hosting provider.
Canonical Name (CNAME)
The CNAME record is used to create a host alias. This is typically used when you need to have multiple hostnames (www,ftp,mail) to point to the same domain. For example, the same server could also be responsible for ftp, or mail. For example:
ftp IN CNAME yourwebsite.com.
www IN CNAME yourwebsite.com.
will create an ftp alias to yourwebsite.com, so that when someone connects to ftp.yourwebsite.com, they will be redirected to yourwebsite.com. Similarly for ‘www’.
Mail Exchange (MX)
The MX record is used to define the A record that will handle all incoming email for that domain. For example, if you want mail.yourwebsite.com to handle all mail addressed to yourwebsite.com you put the following:
website.com. MX 10 mail.website.com
website.com. MX 20 mail-backup.website.com
The number next to the MX string corresponds to priority. If for some reason mail.website.com becomes unavailable, then all mail will be handled by mail-backup.website.com.
The Host Information (HINFO) record can be used to identify hardware type and operating system (OS) information about a host. It is an optional field, and there can be only one HINFO record per host name.
www.yourwebsite.com. IN HINFO "Intel" "Linux"
Pointer records are the opposite of A Records and are used in a set of zone files called Reverse Maps. These provide a mapping, as the name suggests, in a reversed way: IP addresses to host names. These records are vital for e-mail to function properly. Note that there can be only one PTR record for each Internet address. So using the previous example, www.mywebsite.com has IP address 126.96.36.199 thus, its PTR record would be the following.
188.8.131.52.IN-ADDR.ARPA. IN PTR
Note the trailing periods, and that the IP address is written in reverse order.
The Text (TXT) record allows you to associate any string of text with a hostname. You can have multiple TXT records for a host as well.
www.mywebsite.com. IN TXT "owner: firstname.lastname@example.org
IN TXT "production"
On a closing note, be mindful that modifying your DNS configuration can have some pretty dramatic effects, such as a total outage of your mail and your website. If you already are a Pressidium client and wish to associate a domain with a WordPress site, please follow this extensive KB article. As always, if you have any questions, or need help, don’t hesitate to submit a ticket to support -at- pressidium.com.