DNS Records Explained: Nameservers, A, CNAME, MX and TXT in Simple Words
Disclosure: some links in this guide are affiliate links. If you buy through them, Arabic Pixel may earn a commission at no extra cost to you (read our affiliate disclaimer).
DNS is the internet's address book. When someone types your domain, DNS tells their device which server holds your website and which server receives your email. You only need to understand a few record types to manage your own domain.
Nameservers: who answers for your domain
Nameservers decide where your DNS records are managed. If your domain uses your registrar's nameservers, you edit records at the registrar. If you change the nameservers to your host's (for example Hostinger's), you edit records in the hosting panel instead.
Changing nameservers is the simplest way to connect a domain to hosting: the host then sets the right records for you. Our guide to connecting a Namecheap domain to Hostinger shows both methods step by step.
A record: the website's server
An A record points a name to an IPv4 address, such as the IP of your hosting server. The record for the bare domain is usually written as @. An AAAA record does the same for an IPv6 address.
CNAME record: a nickname
A CNAME points one name to another name instead of to an IP. It is often used for www (www pointing to your main domain) or to connect a sub-address like shop.yourdomain.com to a platform.
MX records: where email is delivered
MX records tell other mail servers where to deliver email for your domain. Your email provider (your host, Namecheap Private Email, Google Workspace and so on) gives you the MX values. If MX records are wrong, your website can work perfectly while your email does not arrive.
TXT records: proof and protection
TXT records hold text. They are used to prove you own the domain (for Google Search Console, for example) and for email security:
- SPF lists which servers may send email for your domain.
- DKIM adds a signature so receivers can check the email was not changed.
- DMARC tells receivers what to do with email that fails those checks.
Setting these three helps your emails reach the inbox instead of spam.
Why changes take time: TTL and propagation
Devices and internet providers remember DNS answers for a while to save time. That memory period is the record's TTL. After you change a record, some visitors see the new server at once and others only after their saved answer expires. Nameserver changes can take up to a day or two to reach everyone, though they are often much faster.
Tip: if you plan a move, lower the TTL a day before, make the change, and raise it again afterwards.
Common mistakes
- Editing records at the registrar while the domain uses the host's nameservers (or the other way round). Edit where the nameservers point.
- Deleting MX records when changing hosting, which stops email.
- Two SPF records on one domain. Combine them into one.
- Expecting changes to show instantly. Wait, then test from another network or a DNS checking site.
Check a domain name now → Our free domain search shows which extensions are free and what they cost, then you register on Namecheap.
Need help?
If you would rather not do this yourself, our team can set up your hosting, domain, email and website for you. Get a free quote →
Web hosting, domains and website builder — great for beginners and small businesses.