DNS Record Types
DNS Record Types
DNS record types are records that provide important information about a hostname or domain. These records include the current IP address for a domain. Also, DNS records are stored in text files (zone files) on the authoritative DNS server. The content of a DNS record file is a string with special commands that the DNS server understands.
A (Address) Record:
The A record maps a domain name to an IPv4 address. It is used to resolve a domain name to the corresponding numeric IP address.
Example: Suppose you have a domain "example.com" with the following A record:
example.com IN A 192.0.2.10
In this case, "example.com" is mapped to the IPv4 address 192.0.2.10.
AAAA (IPv6 Address) Record:
The AAAA record is similar to the A record but is used for IPv6 addresses.
Example: If you have a domain "ipv6.example.com" with the following AAAA record:
ipv6.example.com IN AAAA 2001:0db8:85a3:0000:0000:8a2e:0370:7334
Here, "ipv6.example.com" is mapped to the IPv6 address 2001:0db8:85a3:0000:0000:8a2e:0370:7334
CNAME (Canonical Name) Record:
The CNAME record creates an alias or canonical name for an existing A or AAAA record. It allows a domain name to point to another domain name rather than an IP address directly.
Example: Suppose you have a CNAME record like this:
www.example.com IN CNAME example.com
This means that "www.example.com" is an alias for "example.com" Requests for "www.example.com" will be redirected to "example.com"
MX (Mail Exchange) Record:
The MX record specifies the mail servers responsible for receiving email messages addressed to a domain.
Example: If your domain "example.com" uses Google's G Suite for email, the MX record might look like this:
example.com IN MX 10 ASPMX.L.GOOGLE.COM example.com IN MX 20 ALT1.ASPMX.L.GOOGLE.COM
Here, these MX records specify the mail servers (Google's servers) and their priority levels.
Use of MX record:
With an MX record, it's possible to hand off emails to a dedicated email server. For example, you can decide to leave all the trouble of setting up webmail on a server you own to a specialized email provider. This comes with many benefits, including custom email clients for reading and sending emails, and improved security and spam filters. Also, you can use a service like Site24x7 to monitor and verify issues with the mail server your MX records point to.
NS (Name Server) Record:
The NS record specifies the authoritative name servers for a domain.
Example:
example.com IN NS ns1.example-dns.com example.com IN NS ns2.example-dns.com
These NS records indicate that the domain "example.com" is using "ns1.example-dns.com" and "ns2.example-dns.com" as its authoritative name servers.
Use of NS record:
If you've purchased a web hosting service or set up a simple website, you probably received an email with nameserver details. Those nameservers, in simple terms, connect your domain name to the actual server your site is hosted on. The nameserver contains other DNS records for the domain like an A record and MX record.
PTR (Pointer) Record:
The PTR record is used in reverse DNS lookups and maps an IP address to a domain name.
Example:
10.2.0.192.in-addr.arpa. IN PTR mail.example.com
This PTR record states that the IP address 192.0.2.10 has a reverse DNS mapping to "mail.example.com"
SRV (Service) Record:
The SRV record is used to define the location of specific services within a domain.
Example: Suppose you have an SRV record for a Jabber/XMPP service:
_xmpp-server._tcp.example.com IN SRV 5 0 5269 xmpp.example.com
This SRV record indicates that the Jabber/XMPP service is located at "xmpp.example.com" on port 5269.
SOA (Start of Authority) Record:
The SOA record is the first record in a zone file and contains essential information about the domain's authoritative name server and other zone-level parameters.
Example:
example.com IN SOA ns1.example-dns.com admin.example.com ( 2023072301 ; serial number 3600 ; refresh (1 hour) 1800 ; retry (30 minutes) 1209600 ; expire (2 weeks) 86400 ; minimum (1 day) )
Here, the SOA record provides information about the primary name server, the email address of the domain administrator, and various timing values.
TXT (Text) Record:
The TXT record allows domain owners to add arbitrary text information to their DNS records.
Example:
example.com IN TXT "v=spf1 include:_spf.example.com ~all"
This TXT record sets up a Sender Policy Framework (SPF) to specify which servers are allowed to send emails on behalf of "example.com"
CAA (Certification Authority Authorization) Record:
The CAA record specifies which certificate authorities (CAs) are allowed to issue SSL/TLS certificates for a domain.
Example:
example.com IN CAA 0 issue "comodoca.com"
This CAA record indicates that certificates for "example.com" can only be issued by the CA "comodoca.com"
DS (Delegation Signer) Record:
The DS record is used in DNSSEC to store the hash of a DNSKEY record.
Example:
example.com IN DS 12345 8 1 ( 2BB183AF5F22588179A53B0A98631FAD1A292118 )
This DS record is part of the chain of trust used to verify DNSSEC-signed DNS records for "example.com"
DNSKEY (DNS Public Key) Record:
The DNSKEY record holds the public key used in DNSSEC.
Example:
example.com IN DNSKEY 256 3 8 ( AwEAAb/+aSKFy0z7Zz1G9zT0VPJ6vJrj7tXY5k6k9n1z )
This DNSKEY record contains the public key used in DNSSEC for "example.com"
Follow me on : Medium Linkedin Researchgate