What Is DNS and How Does It Work?
A DNS – or Domain Name Server – is basically a server that caches IP addresses so that you can find what you are looking for faster on the web. The DNS server uses the protocol of TCP/IP transmission to deliver the information the fastest and most secure way possible. This protocol layer resides between the internet and application layer of the OSI model. The DNS server updates the Central Registry in which hosting companies receive the most accurate data and thus the most efficient to retrieve quickly.
For example:
- The time that it takes to update the information that has been updated with the DNS server is called the propagation period. During this time, the updated information will be able to be retrieved world-wide within 12-36 hours.
CNAME (Alias)
A CNAME – or Canonical Name – is used for when you have a domain name that you want to make sure forwards to the right page if the domain is entered wrong in the browser. The CNAME prevents common errors in spelling or capitalization. This is also used when you want to redirect content from one domain to a different domain with the same content.
For example:
- If your website domain name was “domain.com” you could create a CNAME on “domain.com” to “domain _example.com”. That way, a user who visits “domain.com” sees the exact same content as on the domain “domain _example.com”. This would require adding an alias field, thus creating a CNAME. The benefit of CNAME is that if the IP address of the alias changes, there is no need for an update as the alias hasn’t changed – only the IP address associated with it. This is one of the benefits of having an CNAME versus an A or AAAA record.
Nameserver
A server name acts as a translator between your registrar and your hosting site. It is common that the registrar and the hosting company are both the same company, but there are times when this is not the case. Picking an affordable domain name with a more highly secure hosting company may be more beneficial than choosing a more expensive domain name with an equally expensive hosting provider. In any case, nameservers are used commonly.
For example:
- If you have purchased your domain name through company A as your registrar and your hosting account from company B. For A to send the request to B a Name Server provides a path between your registrar and your hosting account. That way the DNS server is able to find the appropriate IP address per domain name.
A Record (and AAAA)
An A record is also another tool used to direct the DNS to your site, and it assumes a correct IP path. While A records are used for IPV4 IP addresses, AAAA are used for IPV6 IP addresses.
For example:
- If you are visiting “domain.com”; the A record is the machine-ready IP address associated with the domain name. This way, during TCP/IP transmission the DNS server has the most accurate IP record for the domain name.
MX Record
This is the mail server record for the DNS name of the server that could process emails, which is how the mail server knows which server to send emails. It is recommended to have multiple mail servers in case one fails. This way, the DNS record can pull the next MX record of the highest priority (1 being high, 10 being low) in the hierarchy of MX records. This is done in order for the DNS to retrieve the next mail server that can accept mail for a domain name.
For example:
- If there is an MX record for “domain.com”. In this way a mail server can request the MX record from the DNS server for the appropriate mail server for “domain.com”.