DNS aka Domain Name Server serves as a digital database map that lists which domain every IP address is associated to on the internet and how they should handle the access requests sent to them. These DNS records are an essential to get a website up and running correctly.
Although there are various types of DNS records that all perform different actions, the below four record types are the most commonly used.
1. A records
Also known as Address records, commonly known as host records, resolve IP addresses. They connect the domains you register to the correct IP address so that your website will properly resolve when someone types in the web address.
A records are used when you want to connect a domain name you’ve registered to the server where the website is hosted. Usually, two A records are set up that will successfully point to both a bare and wildcard version of the domain.
- A arne.tech 127.0.0.1
- A *.arne.tech 127.0.0.1
The first A record in this example is pointing the “bare” version of your domain. That means when someone goes to their browser and types in the domain name without www, it will resolve to the right server and website. The second A record is the wildcard version. This redirects any subdomains to your domain to the server; this includes www. and anything else people may type before your domain name.
2. CNAME records
CNAME records aka Canonical Name Records resolve the domains and subdomains. Unlike A records, they cannot be bare (i.e. there needs to be www. in front of them for the URL to properly resolve).
CNAME records are most often used when you want to direct part of your website to an external link. For example, if you wanted to set up an eCommerce site to complement your existing website, a CNAME record would be the simplest way to link them together.
MX stands for Mail Exchange, and is a very different from other records. Unlike most DNS records which resolve to text or the destinations of various IP addresses, MX records are used to direct emails sent to custom addresses associated with a domain name.
If you want to create custom email addresses through your domain name, MX records must be set up so that any emails that go to that address will be directed to the right server and get delivered to you. Typically, your email provider will give you the MX records you need, and then you’ll add it to the domain it’s associated with to finish setup.
As you can probably guess, a TXT record is simply a text record. Although these records cannot be used to change your domain in any way, they are useful for making it easier to search for and find your domain.
Text records are most often used by services like Google. By adding certain strings of characters to your TXT file, search engines and other services are able to search for your domain as well as verify that you are the owner of the domain.