Key facts
- A points a name to an IPv4 address; AAAA points to an IPv6 address.
- A CNAME cannot sit alongside other records at the same name.
- MX records must point to a hostname, never an IP address or a CNAME.
- TXT records carry SPF, DKIM, DMARC and verification codes.
- CAA says which certificate authorities may issue SSL certificates.
- PTR (reverse DNS) is set by whoever owns the IP address.
- "@" in the host field means the domain itself.
Reading a DNS record
Every record has the same basic parts: a name (or host), a type, a value and a TTL. Most DNS control panels show them as columns.
- Name or host. "@" means the domain itself, for example example.co.uk. "www" means www.example.co.uk. Some panels want the full name, others add the domain for you, so check before typing it twice.
- Value. What the record points to: an IP address, a hostname or text.
- TTL. How long, in seconds, resolvers may cache the record. 3600 is one hour. Lower it to around 300 before a planned change.
For the bigger picture of how records are looked up, see how DNS works.
The record types at a glance
| Type | What it does | Example value |
|---|---|---|
| A | Points a name to an IPv4 address | 203.0.113.10 |
| AAAA | Points a name to an IPv6 address | 2001:db8::10 |
| CNAME | Makes one name an alias of another | www to example.co.uk |
| MX | Says which servers receive email, with a priority | 10 mail.example.co.uk |
| TXT | Holds text: SPF, DKIM, DMARC, verification | v=spf1 include:_spf.google.com ~all |
| CAA | Lists certificate authorities allowed to issue SSL | 0 issue "letsencrypt.org" |
| SRV | Points a service to a host and port, with priority and weight | _sip._tls services |
| NS | Names the nameservers for the domain or a delegated subdomain | ns1.example-dns.net |
| PTR | Reverse DNS: maps an IP address back to a name | Set by the IP owner |
Rules that catch people out
- CNAME stands alone. A CNAME cannot share its name with any other record. That is why you cannot normally put a CNAME at "@", where MX and TXT records live. Cloudflare offers CNAME flattening to get round this at the apex.
- MX needs a hostname. The value must be a hostname with its own A or AAAA record, not an IP address and not a CNAME. Lower priority numbers are tried first. See what is an MX record.
- One SPF record only. Two TXT records starting v=spf1 cause SPF to fail. Merge them into one.
- Long TXT values. TXT strings over 255 characters must be split into several quoted strings in the same record. Long DKIM keys often need this.
- PTR is not yours to set. Reverse DNS belongs to whoever owns the IP address, usually your hosting or broadband provider.
A typical small business zone
Most small business domains need only a handful of records:
- An A record at "@" for the website, and a CNAME or A record for "www".
- MX records for the email provider.
- A TXT record for SPF, one or more DKIM records and a TXT record at _dmarc. See SPF, DKIM and DMARC setup.
- Verification TXT records for services such as Microsoft 365 or Google.
- Optionally, a CAA record to limit who can issue certificates.
Before changing anything, copy the whole zone somewhere safe. To check what is live, see how to check DNS records.
How dijitul helps
We add, tidy and fix DNS records, usually in Cloudflare, and check that website, email and verification all still work afterwards. DNS management is included with dijihost Complete Hosting at £1 a day + VAT. On its own it is £45 an hour + VAT. See DNS management and subdomain setup, or contact us.
Frequently asked questions
What does @ mean in a DNS record?
The @ symbol stands for the domain itself, sometimes called the apex or root. A record at @ for example.co.uk applies to example.co.uk, while a record named www applies to www.example.co.uk. Some control panels show the full name instead.
Should www be a CNAME or an A record?
Either works. A CNAME pointing www at the main domain means you only update one A record when the server changes. An A record is fine too. The apex itself normally needs an A record, unless your provider offers CNAME flattening.
Why can't I add a CNAME at the root of my domain?
A CNAME cannot share a name with other records, and the root always has NS records and usually MX and TXT records too. Standard DNS therefore does not allow it. Cloudflare's CNAME flattening gives a similar result by returning the target's address instead.
What is a CAA record for?
A CAA record lists which certificate authorities may issue SSL certificates for your domain. Authorities check it before issuing. It helps stop a certificate being issued by a company you do not use, but it must include the authority your host relies on.
Can I set up reverse DNS (PTR) myself?
Usually not. PTR records live in a zone controlled by whoever owns the IP address, such as your hosting or broadband provider. Ask them to set it. Mail servers check reverse DNS, so it matters if you run your own outgoing mail server.
How long until a record change takes effect?
The new value is live on your nameservers almost at once, but resolvers that cached the old value keep using it until its TTL expires. With a TTL of 300, that is about five minutes; with 3600, up to an hour.
Related
Get domains, DNS and email sorted
Set up properly, records checked, and real people to call. DNS and email are included with dijihost hosting.