Common DNS Record Types Explained
This post covers A records, MX records, NS records, TTL, and TXT records (SPF) — what each means and what to watch out for.
A Record
An address record, used to point a domain at an IPv4 address (for example 8.8.8.8). If you want your domain to point at an IP address, add an A record. To add one, put the subdomain name in “Host”, set “Type” to A, put the server’s IP address in “IP address”, and click “Add”. Note: if the “Host” field is left empty, it means the record applies to the domain mydomain. itself.
Wildcard resolution — pointing every unspecified subdomain of the domain at one IP — works by putting * in “Host”, setting “Type” to A, filling in the server IP, and clicking “Add”.
CNAME Record
If you want the domain to point at another domain, which in turn provides the IP address, you add a CNAME record. This makes the record resolve to the same IP as the domain named in the CNAME record.
MX Record
If you want to set up mail so your mailbox can receive mail, add an MX record. An MX record is a mail routing record: it lets you point the mail server for that domain at your own mail server, after which you control all the mailbox settings yourself. Fill in your server’s IP address and all mail for your domain goes to the mail server you’ve configured. Usually “Host” is empty or @, and the record value is your server’s IP address or domain name.
NS Record
An NS record is a name server record, specifying which DNS server resolves the domain. When you register a domain there’s a default DNS server; every registered domain is resolved by some DNS server. NS record addresses generally look like this:
ns1.XXXXX.com
ns2.XXXXX.com
For example, if a user wants to use another DNS provider or run their own DNS server, they change the NS record. If the server 12.34.56.78 should resolve nes.mydomain., you set the NS record for nes.mydomain.. Notes: the smaller the number in “priority”, the higher the priority; the “IP address” field can take either an IP address or a host address like ns.mydomain., but that host address must be valid.
TXT Records (SPF)
TXT records are often used for SPF — Sender Policy Framework. Hard to read, so people usually just call it SPF.
SPF is a DNS record type proposed to fight spam. It’s a TXT record used to register all the IP addresses a domain uses to send outbound mail. For example:
v=spf1 include:spf.mail.qq.com ~all
A TXT record is generally a note set on a hostname or domain, such as:
admin IN TXT "administrator, phone: xxxxxxxxx"
mail IN TXT "mail host, located at xxx, admin: AAA"
Jim IN TXT "contact: xxx@xxx.com"
In other words, you can set TXT records so people can reach you.
They also improve the deliverability of mail sent from your domain mailbox to outside domains. The reason: the corporate email provider adds your domain to its whitelist and sends mail on the corporate provider’s behalf, and corporate providers don’t block each other.
TTL
TTL stands for “Time To Live”. Simply put, it’s how long a DNS record is cached on DNS servers. Domains are cached by local DNS servers; a larger cache time shortens resolution time but makes record changes take longer to take effect. I recommend setting it to 600 — ten minutes.
Ren Fei, May 7, 2013, 21:27:54

