Skip to content

NewExtra 20% Off on 3-Month Plans! πŸŽ‰ Order your VDS server for 3 months and get an extra 20% off in the cart!

Blog

Tutorials, guides, product news and engineering insights from the team that runs your hosting.

Network & VPN

What Is DNS? What Do A, CNAME and MX Records Do?

11 November 2026 12 min read
Share this post

Reading time: about 11 minutes Β· Level: Beginner Β· Topic: Domain and DNS management

You've got your domain and your hosting plan is ready, but your site won't load or your emails aren't arriving. Behind most problems like these is the same thing: DNS records. Abbreviations such as A, CNAME and MX in the DNS panel may look confusing at first, but each one answers a single, simple question.

In this guide, we explain with examples what DNS is and how it works, what the most commonly used record types do and what TTL and propagation time mean. By the end, you'll be able to read and look up your own domain's records and avoid the most common mistakes.

Short answer

DNS (Domain Name System) is the system that translates domain names into server IP addresses. An A record points a domain to an IPv4 address and determines which server your site loads from. A CNAME record links a name to another domain as an alias. An MX record tells which mail server emails sent to your domain should be delivered to.

Section 1

What Is DNS?

Every server on the internet has an IP address; computers find each other by these addresses. People, however, remember names such as example.com, not numbers such as 203.0.113.10. DNS (Domain Name System) is the system that translates between the two. It's often described as "the phone book of the internet": you type the name and the system gives you the number.

DNS doesn't only work for websites. Many processes, such as which server your emails are delivered to, verifying that a domain really belongs to you and SSL certificates, also rely on DNS records. That's why your domain's DNS records are the most fundamental settings for your site and email to work.

Section 2

How Does a DNS Lookup Work?

When you type an address into your browser, a chain of lookups lasting milliseconds runs in the background before the page opens:

Step 1

Cache check

If your browser and operating system looked up this name recently, they take the answer from the cache and the chain ends here.

Step 2

Recursive resolver

If the answer isn't in the cache, the query goes to the resolver of your internet provider or of a public DNS service such as 1.1.1.1 or 8.8.8.8. The resolver's job is to find the answer on your behalf.

Step 3

Root and extension (TLD) servers

The resolver first asks the root servers, then the servers for the extension, such as .com or .com.tr. These servers don't know the IP address, but they tell which nameservers hold that domain's records.

Step 4

Authoritative nameserver

Finally, the resolver asks your domain's authoritative nameserver. The A, CNAME and MX records you add in the DNS panel are stored here. The server returns the record, and the resolver passes the answer to you and keeps it in its cache for a while.

The most important point here is this: your records take effect where your domain's nameservers point. Whichever company your nameservers are with, you manage your DNS records from that company's panel.

Section 3

DNS Record Types at a Glance

RecordWhat does it do?Example value
APoints the domain to an IPv4 address203.0.113.10
AAAAPoints the domain to an IPv6 address2001:db8::10
CNAMELinks a name to another domain as an aliasexample.com
MXSpecifies the mail server that emails are delivered to10 mail.example.com
TXTCarries text information: SPF, DKIM, DMARC and ownership verifications"v=spf1 mx ~all"
NSSpecifies the domain's authoritative nameserversns1.example-dns.com
SOAHolds the basic administrative information of the DNS zoneCreated automatically
PTRPerforms reverse resolution from an IP address to a domainmail.example.com
SRVSpecifies the server and port of a particular service10 5 5060 sip.example.com
CAARestricts which certificate authorities can issue SSL certificates0 issue "letsencrypt.org"
Info: PTR records aren't added from the domain panel

You don't set a reverse DNS (PTR) record from your domain's DNS panel; you have it set by your server provider, which owns the IP address. It's especially important for mail servers. For more about IP addresses and blocks, see our IP block guide.

Section 4

What Do A and AAAA Records Do?

The A (Address) record is the most basic DNS record: it maps a domain to an IPv4 address. This record determines which server your site loads from. When you change your hosting provider or server, the first record you usually need to update is the A record.

Example: A record

Name (Host): @ (the domain itself, i.e. example.com)

Type: A

Value: 203.0.113.10 (your server's IP address)

  • The @ sign refers to the domain itself (the root domain).
  • You can add separate A records for subdomains: a record added with the name blog points the address blog.example.com.
  • An AAAA record does the same job for IPv6 addresses. If your server has an IPv6 address, you can add an AAAA record alongside the A record.
  • More than one A record can be defined for a name; in that case, requests are distributed among the addresses.
Section 5

What Does a CNAME Record Do?

A CNAME (Canonical Name) links a name not to an IP address but to another domain. It's a way of saying "this name is an alias of that name". Its most common use is linking the www subdomain to the root domain.

Example: CNAME record

Name (Host): www

Type: CNAME

Value: example.com

The advantage of CNAME is easy maintenance: when your server's IP address changes, you only update the A record; all CNAME records linked to it automatically follow the new address. External services such as store, newsletter or helpdesk software also usually ask you to add a CNAME record.

Two important CNAME rules

  • A name with a CNAME can't have any other records. You can't define both a CNAME and an A, MX or TXT record for the same name.
  • You can't add a CNAME to the root domain (@). Because the root domain must have NS and SOA records, this conflicts with the first rule. Use an A record for the root domain. Some DNS providers offer a special solution for this need called "CNAME flattening" or ALIAS.
Section 6

What Does an MX Record Do?

The MX (Mail Exchanger) record determines which mail server emails sent to your domain are delivered to. When someone sends you an email, the sending server first looks at your domain's MX record and passes the message to the server there.

Example: MX record

Name (Host): @

Type: MX

Priority: 10

Value: mail.example.com

  • Priority value: If there's more than one MX record, the one with the lower number is tried first. If the server with priority 10 can't be reached, the backup server with priority 20 takes over.
  • MX must point to a domain name, not an IP address. The name you enter as the MX value (mail.example.com) must have its own A record. This name also shouldn't be a CNAME.
  • Your site and email can be in different places. Your A record can point to your web server and your MX record to a completely different email provider. When you change your email service, you only update the MX and related TXT records; your site isn't affected.

If you want to use email addresses on your own domain, just add the MX values provided with the business email service to your DNS panel.

Section 7

TXT Records: SPF, DKIM and DMARC

A TXT record lets you add free text to your domain. Today it's mostly used for two purposes:

  • Email authentication: SPF, DKIM and DMARC records are added as TXT. These records declare who can send email on behalf of your domain and help keep your emails out of the spam folder.
  • Ownership verification: Services such as Google Search Console ask you to add a specific TXT record to prove that the domain belongs to you.

The MX record makes sure email reaches you, while SPF, DKIM and DMARC make sure the email you send is trusted on the other end. You can find step-by-step instructions for setting up these three records in our guide explaining why business emails go to spam.

Section 8

NS Records, TTL and Propagation Time

NS records and nameservers

NS (Name Server) records specify which servers hold your domain's DNS records. You change the nameservers from the panel of the company you registered your domain with. When you switch the nameservers to another provider, you manage all your DNS records from that provider's panel from then on.

What is TTL?

TTL (Time To Live) determines how many seconds a record is kept in resolvers' caches. When you change a record with a TTL of 3600, resolvers that have cached the old answer will keep using it for up to one more hour.

  • Low TTL (e.g. 300 seconds): Changes take effect quickly; useful during migrations.
  • High TTL (e.g. 3600–86400 seconds): Fewer lookups and faster responses; suitable for records that rarely change.
Tip: Lower the TTL before a migration

If you're going to move your site to a new server, lower the TTL of the relevant records to 300 seconds at least a day before the move. That way, when you change the A record, visitors are directed to the new server within a few minutes. Once the migration is complete, you can raise the TTL again.

What does "DNS propagation" mean?

When you change a record, the change takes effect immediately on the authoritative nameserver. However, resolvers around the world may keep the old answer in their cache until the TTL expires. This delay is what's referred to as "propagation". Individual record changes usually complete within minutes to a few hours, while nameserver (NS) changes can take up to 24–48 hours.

Section 9

Example: DNS Records for a Typical Site

The DNS records of a small business with a website and email often consist of the five rows below. The IP addresses are examples; use the values provided by your own server and email provider.

Name (Host)TypeValuePurpose
@A203.0.113.10Points the site to the web server
wwwCNAMEexample.comLinks the www address to the main domain
@MX10 mail.example.comDelivers emails to the mail server
mailA203.0.113.20Provides the mail server's IP address
@TXT"v=spf1 mx ~all"Declares the servers authorized to send email (SPF)
Section 10

How to Look Up DNS Records

You can check from your own computer in a few seconds whether a record was added correctly. Replace example.com in the commands with your own domain.

Windows (Command Prompt)
nslookup -type=A example.com
nslookup -type=CNAME www.example.com
nslookup -type=MX example.com
nslookup -type=TXT example.com
Linux / macOS (Terminal)
dig +short A example.com
dig +short CNAME www.example.com
dig +short MX example.com
dig +short NS example.com

To see whether the change has propagated worldwide, you can also send the query to a specific public resolver. If different resolvers give different answers, propagation isn't complete yet:

Asking a specific resolver
nslookup example.com 1.1.1.1
nslookup example.com 8.8.8.8
Section 11

Common Mistakes

Mistake 1

Editing the record in the wrong panel

This is the most common mistake. If your domain's nameservers point to company A and you add a record in company B's panel, nothing changes. First find your nameservers with nslookup -type=NS example.com, then edit the records in that provider's panel.

Mistake 2

Forgetting the www record

If an A record is added only for the root domain, the site loads at example.com but not at www.example.com. Add a CNAME or A record for www as well.

Mistake 3

Entering an IP address in the MX record

The MX value can't be an IP address. First create an A record for the mail server (e.g. mail), then use that name in the MX record.

Mistake 4

Adding more than one SPF record

A domain should have only one SPF record. When adding a new email service, update the existing record instead of creating a second SPF record; otherwise validation fails.

Mistake 5

Not moving records when changing nameservers

When you switch the nameservers to a new provider, the records in the old panel aren't moved automatically. Before the change, create all existing records (especially MX and TXT) at the new provider; otherwise your email will be interrupted.

Mistake 6

Sending the mail server record through a CDN proxy

If you use a CDN such as Cloudflare, the mail record that the MX record points to must be unproxied ("DNS only"). These proxies only carry web traffic; they don't carry email traffic.

Section 12

Frequently Asked Questions

What is the difference between an A record and a CNAME record?

An A record links a name directly to an IP address. A CNAME links a name to another domain; the IP address is found from that domain's A record. An A record is used for the root domain, and usually a CNAME for subdomains such as www.

How long does it take for a DNS change to take effect?

It depends on the record's TTL. A change to a single record usually takes effect within minutes to a few hours. Nameserver changes can take up to 24–48 hours.

Can I receive email without an MX record?

Don't rely on it. According to the standards, if there's no MX record, the sending server may try to deliver to the address in the domain's A record; however, this isn't a reliable method. If you'll use email, always define an MX record.

Are DNS and hosting the same thing?

No. Hosting is the server where your site's files live. DNS is the set of records that points your domain to that server. The two can be with the same company or with different companies.

What should I do if my domain and hosting are with different companies?

There are two ways: you can switch your domain's nameservers to your hosting provider's nameservers, or, without changing the nameservers, point just the A record to your hosting server's IP address. If your email is elsewhere, the second way is safer because it doesn't touch your MX records.

What should I set the TTL to?

For most records, 3600 seconds (1 hour) is a balanced value. Use 300 seconds for records you plan to change soon, and raise it again once the change is complete.

Section 13

Conclusion

Each DNS record answers a single question: the A record answers "which server is this site on?", CNAME "which name is this an alias of?", MX "where should emails be delivered?" and TXT "who can send email on behalf of this domain?". Always edit records in the panel where your domain's nameservers are, verify them after a change with nslookup or dig, and don't forget to lower the TTL before a migration.

Register Your Domain with Netiyo

You can search for and register a domain that fits your brand, or transfer your existing domain and manage everything from your panel. Also take a look at our web hosting options for your site and business email for your email.

Search for a Domain
Never Miss a Post

Get our latest tutorials, guides and product news in your inbox.

You're subscribed to our newsletter.