Domain Name System (DNS) records are essential components that help to translate human-friendly domain names (like www.example.com) into IP addresses that computers understand. There are various types of DNS records, each serving a unique purpose. To help you understand these records, let's use a metaphor: think of the DNS as a phone book for the internet, and the different DNS record types as various sections in that phone book.
DNS records (aka zone files) are instructions that live in authoritative DNS servers and provide information about a domain, including what IP address is associated with that domain and how to handle requests for that domain. These records consist of a series of text files written in what is known as DNS syntax. DNS syntax is just a string of characters used as commands that tell the DNS server what to do. All DNS records also have a ‘TTL’, which stands for time-to-live, and indicates how often a DNS server will refresh that record.
What are the most common types of DNS record?
- A (Address) Record: An A record is like a standard phone book entry that maps a domain name to an IP address. When you type a website address into your browser, the A record tells your computer the IP address associated with that domain name. Example: example.com -> 192.0.2.1
- AAAA (IPv6 Address) Record: An AAAA record is similar to an A record but is used for IPv6 addresses (the newer IP address format). It maps a domain name to an IPv6 address. Example: example.com -> 2001:0db8:85a3:0000:0000:8a2e:0370:7334
- CNAME (Canonical Name) Record: A CNAME record is like a phone book alias. It maps one domain name to another domain name, allowing multiple domain names to point to the same IP address. Example: www.example.com -> example.com
- MX (Mail Exchange) Record: An MX record is like the post office section of the phone book, directing mail servers where to deliver email messages for a domain. MX records point to mail servers responsible for accepting email on behalf of the domain. Example: example.com -> mailserver.example.com
- TXT (Text) Record: A TXT record is a versatile record type that can store text information for various purposes, such as verifying domain ownership, implementing SPF (Sender Policy Framework) to prevent email spoofing, or providing other service-specific configuration details. Example: example.com -> "v=spf1 include:_spf.example.com -all"
- NS (Name Server) Record: An NS record is like a directory assistance for the DNS phone book. It tells which name servers are responsible for managing the DNS records of a domain. Example: example.com -> ns1.example.com, ns2.example.com
- SRV (Service) Record: An SRV record is like a specialized directory assistance that helps locate specific services on a domain, such as instant messaging or Voice over IP (VoIP) services. It provides the hostname, port, and priority of the service. Example: _sip._tcp.example.com -> 0 5 5060 sipserver.example.com
- PTR (Pointer) Record: A PTR record is like a reverse phone book lookup. It maps an IP address back to a domain name, mainly used for reverse DNS lookups to verify that an IP address is associated with a specific domain. PTR records are primarily used for diagnostic and anti-spam purposes. Example: 1.2.0.192.in-addr.arpa -> example.com
In summary, these DNS record types help computers find and connect to the services and resources associated with a domain name, such as websites, email servers, and other internet services. Each record type serves a specific purpose, and together, they help keep the internet organized and functioning smoothly.