====== Networking - DNS - Common Record Types ======
Common examples of DNS records include:
^DNS Record^Function^
|A|A Records are the most basic type of DNS record. A Records are used to point a domain or subdomain to an IP address.|
|CNAME|CNAME records create an alias to an existing A record.|
|MX|Mail Exchanger (MX) records are used to help route email. MX records differ from A Records and CNAMEs in that they also require a "priority" value as a part of their entry.|
|NS|NS record are used to define which servers serve copies of a zone.|
|TXT|A TXT record is used to store text-based information (e.g., to hold SPF data and verify domain ownership).|
----
===== A record =====
This record maps an IP Address to a hostname.
www IN A 192.168.1.12
----
===== CNAME record =====
Used to create an alias to an existing **A record**.
web IN CNAME www
**NOTE:** You cannot create a CNAME record pointing to another CNAME record.
----
===== MX record =====
Used to define where email should be sent to.
@ IN MX 1 mail.example.com.
mail IN A 192.168.1.13
**NOTE:** Must point to an **A record**, not a **CNAME**.
----
===== NS record =====
Used to define which servers serve copies of a zone.
@ IN NS ns.example.com.
@ IN NS ns2.example.com.
ns IN A 192.168.1.10
ns2 IN A 192.168.1.11
**NOTE:** It must point to an **A record**, not a **CNAME**.
This is where Primary and Secondary servers are defined.
----
===== TXT record =====
Used to store text-based information:
example.com. IN TXT "This domain name is reserved for use in documentation"
# The character string from a TXT record used for SPF:
"v=spf1 ip4:192.0.2.0/24 ip4:198.51.100.123 ip6:2620:0:860::/46 a -all"
# An example of use for DMARC:
"v=DMARC1;p=none;sp=quarantine;pct=100;rua=mailto:dmarcreports@example.com;"
# Use for site verification:
"google-site-verification=6P08Ow5E-8Q0m6vQ7FMAqAYIDprkVV8fUf_7hZ4Qvc8"
# Use for custom email service:
_amazonses.example.com. IN TXT "pmBGN/7MjnfhTKUZ06Enqq1PeGUaOkw8lGhcfwefcHU="
**NOTE:** Text records can be used:
* for sources outside of your domain.
* to hold SPF data and verify domain ownership.