Domains & web

DNS records in short

What A, AAAA, CNAME, MX, TXT and SRV records do and how to check they work.

DNS turns your domain name into your server's address. Each record says one thing about the domain: where the site is, where email goes, or which port a service runs on.

The types you will use

TypeWhat it doesExample content
APoints a name to an IPv4 addressSERVER_IP
AAAAPoints a name to an IPv6 address2001:db8::1
CNAMEMakes a name an alias of another nameyourdomain.com
MXSays where email is deliveredmail.yourdomain.com
TXTFree text, used for verification and SPFv=spf1 mx ~all
SRVSays which host and port a service runs on0 5 25565 play.yourdomain.com

Record names

  • @ means the domain itself, yourdomain.com.
  • www creates www.yourdomain.com.
  • Any other name creates a subdomain: play becomes play.yourdomain.com.

TTL

TTL (time to live) is how many seconds other servers cache the answer. Cloudflare's Auto value is right almost every time. Before you move a site to another server, lower the TTL to 300 so the change shows up quickly.

Check a record

Run this on your computer, in Command Prompt, PowerShell or a terminal:

bash
nslookup yourdomain.com
nslookup -type=MX yourdomain.com
nslookup -type=SRV _minecraft._tcp.play.yourdomain.com

On Linux and macOS you can also use dig:

bash
dig +short yourdomain.com A

If the answer still shows the old value, wait for the TTL to pass and try again.

Next