What are DNS records?

A DNS (Domain Name System) is a naming database where internet domain names are identified and matched with their IP (Internet Protocol) addresses. Essentially, the DNS uses the name of a website a person enters (E.g. www.domain.com) and connects it with the associated IP address (a series of numbers with periods) a computer uses in order to locate the same website. DNS records should be set wherever the name servers point, usually the host.

The domain name along with its corresponding IP address are referred to as a DNS record. Designated nameservers are responsible for storing DNS data—keeping everything functioning smoothly. When you visit a website repeatedly, it is cached by your computer’s DNS cache. If it hasn’t been visited and cached, a request is sent to your local DNS server.


Types of DNS records

Below are the most common DNS record types:

A or address record (IPv4)

An A record is used to match a domain name to an IPv4 address in order to retrieve it. It makes the internet human-friendly by allowing you to enter the name of the website instead of remembering numbers. For example, an A record would allow you to use a website like www.yourdomain.com in place of an IP address like

AAAA address records (IPv6)

An AAAA record is also an address record and has the exact same functionality as an A record, however, it is used for domains that have IPv6 addresses. Here an AAAA record would allow you use www.yourdomain.com instead of an IPv6 address like 2001:0db8:85a3:0000:0000:8a2e:0370:7334

CNAME record (canonical name)  

CNAME records point domains or subdomains to another domain. For example, if you have a few subdomains such as mail.yourdomain.com and want them to point to your main domain name of yourdomain.com. 

TXT record (text record)

TXT records are used for various authentication methods. They are mainly used to verify the ownership of a domain and prevent spam by determining if the email was sent from a trusted source. You can have multiple TXT records. An example of a TXT record:

example.com record type: value: TTL
@ TXT Information about the domain. 32600

NS record or nameservers

Nameservers are the servers where all DNS records are stored. In order to have a site live, you will need to have properly configured your nameservers. Nameservers are provided by domain name registrars or hosting providersAn example of an NS record is:

domain.com record type: value: TTL
@ NS ns1.domainserver.com 21600


MX records (mail exchanger) 

MX records are used to point your domain to email servers using SMTP (Simple Mail Transfer Protocol). Email service providers give you a few servers in case that one or two of the servers should fail. These servers have a priority number set in front of them. They indicate the primary and backup mail servers. An example would be emails sent to [email protected] would be sent to mail server mail.yourdomain.com with its specific IP address.

PTR record (pointer to a canonical name)

PTR records are used to track an IP address to its domain or reverse DNS lookup. They are used to troubleshoot email delivery and for anti-spam. For example, the PTR record for the IP address would be stored under with an “.in-addr.arpa” added at the end.

SRV record (generalized service location)

Used for services such as VoIP and SIP. SRV records specify the ports within the DNS which serve as virtual starting and ending points of different network traffic. An example SRV would be 

_xmpp._tcp.domain.com. 86400 IN SRV 10 5 5223 server.domain.com

Less commonly used DNS records include AFSDB record, CAA record, DNSKEY record, etc.