DNS Record Types Explained
DNS records store information about domains and their associated IP addresses. Each record type serves a specific function in directing and managing internet traffic. This guide explains the most common DNS record types and their uses.
Common DNS Record Types
1. A Record (Address Record)
Maps a domain name to an IPv4 address.
Example:
example.com. 3600 IN A 192.0.2.1
2. AAAA Record (IPv6 Address Record)
Maps a domain name to an IPv6 address.
Example:
example.com. 3600 IN AAAA 2001:db8::1
3. CNAME Record (Canonical Name Record)
Alias for another domain name.
Used to redirect a domain to another host.
Example:
www.example.com. 3600 IN CNAME example.com.
4. MX Record (Mail Exchange Record)
Specifies mail servers responsible for receiving emails.
Example:
example.com. 3600 IN MX 10 mail.example.com.
5. TXT Record (Text Record)
Stores human-readable text or machine-readable data.
Commonly used for domain verification and security policies.
Example:
example.com. 3600 IN TXT "v=spf1 include:_spf.example.com ~all"
6. NS Record (Name Server Record)
Specifies authoritative name servers for a domain.
Example:
example.com. 3600 IN NS ns1.example.com. example.com. 3600 IN NS ns2.example.com.
7. PTR Record (Pointer Record)
Resolves an IP address to a domain name (reverse DNS lookup).
Example:
1.2.0.192.in-addr.arpa. 3600 IN PTR example.com.
8. SOA Record (Start of Authority Record)
Provides administrative details about a DNS zone.
Contains information like the primary name server, contact email, and serial number.
The serial number is used to track changes to the zone file. It is typically updated when modifications are made, helping secondary name servers determine when they need to update their copies of the zone.
Example:
example.com. 3600 IN SOA ns1.example.com. admin.example.com. 2024010101 3600 900 1209600 86400
9. SRV Record (Service Record)
Defines the location (hostname and port) of services like SIP or LDAP.
Example:
_sip._tcp.example.com. 3600 IN SRV 10 5 5060 sipserver.example.com.
10. CAA Record (Certification Authority Authorization Record)
Specifies which certificate authorities (CAs) can issue SSL certificates for the domain.
Example:
example.com. 3600 IN CAA 0 issue "letsencrypt.org"
Conclusion
Understanding DNS records is essential for proper domain management and network security. Configuring the right DNS records ensures efficient website performance, email reliability, and domain security.