DNS Record Types

Domain names are hosted on name servers as DNS Records like A records, CName record, TXT record and so on. The combination of Names servers and DNS records is called as DNS Zones.

DNS servers create a DNS record to provide important information about a domain or hostname, particularly its current IP address. The most common DNS record types are:

1. The A record maps a name to one or more IP addresses when the IP are known and stable.

2. The CNAME record maps a name to another name. CNAME stands for Canonical Name. It should only be used when there are no other records on that name.

A common example is when you have both example.com and www.example.com pointing to the same application and hosted by the same server. In this case, to avoid maintaining two different records, it’s common to create:

An A record for example.com pointing to the server IP address

A CNAME record for www.example.com pointing to example.com

As a result, example.com points to the server IP address, and www.example.com points to the same address via example.com.

Should the IP address change, you only need to update it in one place: just edit the A record for example.com, and www.example.com automatically inherits the changes.

A CNAME record must always point to another domain name, never directly to an IP address.

A CNAME record cannot co-exist with another record for the same name. It’s not possible to have both a CNAME and TXT record for www.example.com.

Use a CNAME record if you want to alias one name to another name, and you don’t need other records (such as MX records for emails) for the same name.

You should never use a CNAME record for your root domain name (e.g. example.com).

3. An AAAA record maps a domain name to the IP address (IPv6) of the computer hosting the domain. An AAAA record is used to find the IP address of a computer connected to the internet from a name. The AAAA record is conceptually similar to the A record, but it allows you to specify the IPv6 address of the server, rather than the IPv4.

4. Mail exchanger record (MX Record) specifies an SMTP email server for the domain, used to route outgoing emails to an email server. MX records allow you to provide multiple servers for maximum redundancy and ensured delivery.

5. Text Record (TXT Record) was originally used for arbitrary human-readable text in a DNS record. Since the early 1990s, however, this record more often carries machine-readable data, such as specified by RFC 1464, opportunistic encryption, Sender Policy Framework, DKIM (records stores important information used in the validation of email in transit), Domain-based Message Authentication Reporting and Conformance (DMARC records mitigate phishing and spoofing email attacks), DNS-SD, Site Verification Records (This record proves ownership of a domain and can be used to associate services such as Microsoft 365 and G-Suite to a specific domain) etc.

Comments