Appearance
Common DNS records explained
type | full name | example (subdomain, record type, TTL, data) | description |
---|---|---|---|
NS | Name server | ns1 1h ns-cloud1.googledomains.com. | domain/subdomain to name server mapping; name server holds the resource records and returns corresponding ip address |
A | Address record | @ A 1h 123.123.123.123 | domain name to IPv4 address mapping |
AAAA | IPv6 Address record | www AAAA 1h 2002:db80:1:2:3:4:567:89ab | domain name to IPv6 address mapping |
CNAME | Canonical name | www CNAME 1h example.com. | maps a domain to another domain |
TXT | Text record | @ TXT 1h "key=arbitrary-value-here" | stores arbitrary text, often used for SPF, DKIM, or domain verification |
MX | Mail exchange | @ MX 1h 10 mailhost2.example.com. | domain name to mail server mapping; can specify priority |
CAA | Certification Authority Authorization | example.com. IN CAA 0 issue "letsencrypt.org" | let certain CA to issue certificates for the domain |
Basic concepts
Each record will comprise of the following data:
- subdomain:
- sometimes also just called name
- associates a subdomain with a record (when there is no IP addresses associated, it's not really a subdomain, thus name)
- "@" means the root domain
- record type: from a list of commonly agreed values. Some DNS provider might also have custom record types
- TTL: time to live, how long the record can be cached
- data: a string. format varies depending on the record type
- priority (optional): you can define multiple records with the same type on the same subdomain, for fallback / load balancing purposes.
Commands to inspect DNS records
There are many come installed, I usually only use these two:
host example.com
: for human readable resultdig example.com
: for raw result
for a specific record type, use
host -t <record-type> example.com
dig example.com <record-type>