DNS records explained: A, MX and TXT lookups | ProveFix
مقالات المدونة مكتوبة باللغة الإنجليزية. باقي الموقع متاح بلغتك.
Technical SEO
DNS records explained: how to look up A, MX and TXT records
DNS records decide where your site and email go. Here is what each common record does, how to look them up, and how to fix the DNS mistakes that most often break websites and email.
بقلم Editorial team··قراءة في 7 دقائق·حُدّث في
DNS records are the entries that tell the internet where to send traffic for your domain: which server hosts the website, which servers receive email, and which services are allowed to send email for you. To look up a domain's records, you query its DNS for a record type, such as A for the website's address, or a TXT record lookup for verification codes and email rules.
This guide explains the common record types in plain words, how to run a lookup, and the DNS mistakes that most often break websites and email.
What are the main DNS record types?
Record
What it does
Example
A
Points a name to an IPv4 address
example.com → 203.0.113.10
AAAA
Points a name to an IPv6 address
example.com → 2001:db8::10
CNAME
Makes one name an alias of another
www → example.com
MX
Names the servers that receive email
10 mail.example.com
TXT
Holds text, used for email rules and verification
v=spf1 include:_spf.example.net ~all
NS
Names the servers that answer for the domain
ns1.provider.net
CAA
Says which authorities may issue SSL certificates
0 issue "letsencrypt.org"
SOA
Holds the zone's admin details and serial number
Set by your DNS provider
Each record also has a TTL, the time to live, in seconds. It tells resolvers how long to cache the answer, which is why a change can take a while to reach everyone.
How to do a TXT record lookup
A TXT record lookup asks a domain's DNS for its TXT records. You can do it three ways:
On the command line:nslookup -type=TXT example.com on Windows, or dig TXT example.com on macOS and Linux.
For a subdomain, look up the full name, such as dig TXT _dmarc.example.com for DMARC.
With a DNS checker, which looks up every record type at once and compares the answer from each name server.
TXT records usually hold three kinds of data:
SPF, starting with v=spf1, which lists the servers allowed to send email for the domain.
DMARC, at _dmarc.example.com, starting with v=DMARC1, which tells receivers what to do with email that fails checks.
Verification codes from services such as Google Search Console or email providers.
DKIM keys are also TXT records, at a name like selector._domainkey.example.com, where the selector is set by your email provider.
Why DNS changes take time to show
DNS changes take time because resolvers around the world cache the old answer until its TTL runs out. A record with a TTL of 3600 can stay cached for up to an hour after you change it. People call this propagation.
To make planned changes faster, lower the TTL to a few minutes a day before the change, make the change, then raise it again afterwards. Comparing the answer from each of your name servers shows whether the change has reached all of them.
Common DNS problems and how to fix them
Problem
What breaks
Fix
A record points to an old server
The site loads an old copy or not at all
Update it to the current server's IP
CNAME at the root domain
Other records at the root can break
Use an A record, or your provider's ALIAS or flattening
Two SPF records
SPF fails, email lands in spam
Merge them into one v=spf1 record
SPF over 10 lookups
SPF fails at receivers
Remove unused include: entries
No DMARC record
Spoofing is easier and some providers penalise mail
Add v=DMARC1; p=none; and tighten it over time
Name servers disagree
Some visitors get different answers
Fix the records at the provider, check every server
Moving a site or email to a new host is when DNS mistakes happen most. Before you switch:
Export every current record from the old provider, including TXT and CAA records that are easy to miss.
Lower the TTL of the records you'll change, a day ahead.
Recreate the records at the new provider and compare them line by line.
Keep the email records (MX, SPF, DKIM, DMARC) exactly as they are unless email is moving too.
Switch the name servers or the changed records.
Check every name server's answer and test the site and email from outside.
Raise the TTL again once everything works.
How DNS affects SEO
DNS doesn't rank pages, but it decides whether search engines can reach them. If DNS fails, crawlers can't connect, and a long outage can cause pages to drop. Slow DNS also adds time to the first visit. Keep DNS with a reliable provider and watch it like any other part of uptime.
Check DNS records with the DNS Checker
The DNS Checker looks up A, AAAA, CNAME, MX, TXT, NS, CAA and SOA records in a few seconds, using public DNS only. It compares the answer from each name server, reads and tests SPF, DMARC and DKIM records for email, shows each record's TTL, and explains what each problem breaks and how to fix it.
If a site won't load at all, the Website Down Checker shows whether the failure is in DNS or further along. Domain and certificate expiry dates are in the SSL Checker.
الوسوم
dns
txt records
spf
dmarc
أسئلة وأجوبة
How do I look up a TXT record?
Run nslookup -type=TXT example.com on Windows or dig TXT example.com on macOS and Linux, or use a DNS checker. For DMARC, look up _dmarc.example.com instead.
What is a TXT record used for?
Mostly for email rules and verification: SPF lists allowed senders, DMARC sets the policy for failing mail, DKIM holds signing keys, and services use TXT codes to prove you own the domain.
How long do DNS changes take?
Up to the record's TTL, often minutes to a few hours. Lowering the TTL a day before a planned change makes the switch faster.
Can I have two SPF records?
No. A domain must have only one SPF record. Two records make SPF fail, so merge every sender into one v=spf1 record.