What You Need To Know About DNS Records

DNS-Hosting-screenshot-2

If you own or manage a web site, you should know that basic domain name server (DNS) service is important to delegating your web, email and other services on the Internet.  We include an unlimited free DNS Hosting service with our servers just for this purpose. You can sign up for the service for free, for you to host unlimited number of domains to be hosted on our name servers (ns1.simplercloud.com and ns2.simplercloud.com).

However, to ensure that your services, such as web and mail services, are running properly, you would need to add the correct DNS records. There are different types of DNS records you need to add, and on this blog post, we will be discussing some of the most commonly used records.

A record

This is the most commonly used record, and it’s quite straightforward. The “A” stands for “address”, so A record is an address record, which will map a hostname into IP address. For example, if you want to point company.com to an IP address, say 10.10.10.10, then you would need to create this A record:

company.com     IN    A    10.10.10.10

CNAME record

CNAME stands for “canonical name”, so it’s used for an alias of one hostname to another hostname. For example, if you want http://www.company.com to be an alias of company.com (which will in turn point the domain to the same IP address), you just need to create this CNAME record:

http://www.company.com    IN     CNAME    company.com

MX record

MX stands for Mail eXchanger, and MX records are used to set the list of mail servers which are responsible to accept e-mails for the particular domain. It is very common for a domain name to have more than one MX record — if that’s the case, then the one with the lowest priority number is the primary mail server. The rest of the MX entries with higher priority numbers are the secondary mail servers, which act as a relay to accept and hold the e-mails in its queue when the primary mail server is down. When the primary mail server is back up, then the secondary mail servers will push the emails to the primary mail server.

For example, say the mail server for company.com is hosted on a server with IP address: 10.10.10.11, and there’s another mail server with IP address: 10.10.10.12 which acts as a secondary relay server. Firstly, you would need to create the A records for the servers, since an MX record can only be pointed to a hostname, and cannot be pointed to an IP address.

mail.company.com    IN     A     10.10.10.11
mail2.company.com    IN    A    10.10.10.12

Then you can create the MX records for the domain company.com as follows. Take note that the numbers 10 and 20 are the priority. Lower priority should be set for the primary mail server.

company.com    IN   MX    10   mail.company.com
company.com    IN   MX    20   mail2.company.com

NS record

NS stands for name server, and as per its name suggests, it is used to set the name servers for the domain. For domains hosted under our DNS Hosting service, the NS records should be pointed to our name servers: ns1.simplercloud.com and ns2.simplercloud.com, and it’s already created automatically when you add a domain through our DNS Hosting control panel.

company.com    IN   NS   ns1.simplercloud.com
company.com    IN   NS   ns2.simplercloud.com

TXT record

TXT stands for text, and these text records are used for multiple purposes. One of its purpose is to set SPF (Sender Policy Framework) records, which is now becoming more commonly used for email validation. An example of a SPF TXT record would be like this:

company.com    IN   TXT   “”v=spf1 mx ip4:10.10.10.11 ip4:10.10.10.12 ~all”

SOA records

Similar to NS records, SOA records are automatically being filled-in under our DNS Hosting service. SOA stands for “start of authority”, and these SOA records contain some information about the domain itself. This is an example of a SOA record:

ns1.simplercloud.com indra.sg.or.id (
2014070908; Serial
10800; Refresh
3600; Retry
1814400; Expire
7200 Minimum TTL
)

The record contains:

1. The primary name server for the domain (in the above case, it’s ns1.simplercloud.com).
2. The email address of the domain’s responsible party.
3. SOA serial number, which is normally in the form of timestamp (e.g. YYYYMMDDnn). nn is the revision number if there are any changes done within the same day.
4. The refresh time, which is the time (in seconds) before a zone should be refreshed by a slave DNS server from the master.
5. The retry time, which is the time (in seconds) before a failed refresh by a slave DNS server (as above) should be re-tried.
6. The expire time, which is the maximum time (in seconds) a slave server will keep a cached zone file as valid.
7. The minimum TTL, which is the time (also in seconds) that the slave servers should cache the zone file.

Under our DNS Hosting service, the SOA records have been prefilled in automatically for you.

TTL

TTL stands for “time to live”. If you notice, there are two different type of TTL records, the TTL itself (which is available on every DNS entry) and the minimum TTL (which is only available on the SOA records). The TTL on each entry defines the duration (in seconds) that the particular record should be cached by client side programs, and this TTL value can be different for each value. For example, you can set a different TTL value for company.com and mail.company.com, for example.

On the other hand, the minimum TTL applies to all the records within the zone, and this record is meant for slave and cache DNS servers around the globe, to let them know how long they should cache the zone records before they mark them as expired. The higher you put the value, the longer other DNS servers will cache, increasing the DNS propagation time when any changes to the DNS records were made. However, we can’t set this value to be very low as well, since it will increase the traffic to the DNS servers from other DNS servers. Under our DNS Hosting service, the default minimum TTL set is 7200 seconds.

Other DNS Records

Other than the above, there are some other types of DNS records which are less commonly used by the users and mostly used by service providers, such as AAAA record (to point a hostname to an IPv6 address), PTR record (to perform reverse DNS pointer, pointing IP address back to hostname), SRV record (used for service-based location), etc. However, for you to start using a domain and get the domain up and running for website and email, the above DNS records should be sufficient.

 

As you can see, adding the DNS records for your domain is quite easy, provided that you understand all the functionality and purpose for each record. Nevertheless, feel free to let us know if you need our assistance and advice on how to setup the zone records for your domain.

Advertisements