TürkiyeVPS

What Is DNS and How Does It Work? A, CNAME, MX and NS Records

DNS is the internet's phone book: it translates domain names into IP addresses. We explain how DNS works, the most common record types, and why you have to wait for so-called "DNS propagation."

4 min read

DNS (Domain Name System) is the system that translates domain names into IP addresses that computers understand. Just as your phone finds the number when you tap "Sarah" in your contacts, DNS finds out which server a name belongs to when you type turkiyevps.com into your browser.

How does DNS work?

When you visit a website, here's roughly what happens behind the scenes:

  1. Your computer first checks its own cache: Have I looked up this address recently?
  2. If not, it asks your internet provider's (or your chosen) DNS resolver.
  3. The resolver goes, in order, to the root servers, the extension servers (such as .com), and finally to the domain's authoritative nameserver.
  4. The authoritative server returns the correct IP address, the answer is cached, and your browser connects to the site.

This usually takes just milliseconds.

What is a nameserver (NS)?

A nameserver is the server that holds a domain's DNS records. The "nameserver" setting at the company where you registered your domain determines where your records are managed, for example ns1.examplecompany.com and ns2.examplecompany.com. If you enter your hosting company's nameservers, that company manages your DNS records.

The most common DNS records

Record What does it do? Example
A Points a domain to an IPv4 address example.com → 203.0.113.5
AAAA Points a domain to an IPv6 address example.com → 2001:db8::5
CNAME Points one name to another name www.example.com → example.com
MX Specifies which server receives email example.com → mail.example.com
TXT Verification and email security (SPF, DKIM) info v=spf1 include:... ~all
NS Lists the domain's authoritative nameservers ns1.example.com

How do I connect my site to a server?

The most common method is to add two records:

  1. An A record for the root domain (example.com) pointing to your server's IP address.
  2. A CNAME record for www pointing to the root domain, or a second A record pointing to the same IP.

If you're using a VPS, you can find your IP address in your customer panel.

TTL and "DNS propagation"

Every DNS record has a TTL (Time To Live) value. It specifies, in seconds, how long an answer should be kept in cache. When you change a record, servers that have cached the old answer keep showing the old address until the TTL expires. This waiting period is what people call DNS propagation. A change usually reaches everyone within a few minutes to a few hours; in the worst case, it can take up to 48 hours.

Tip: If you lower your records' TTL (e.g., to 300 seconds) a day before a migration, the change will propagate much faster.

Common DNS problems

  • The site won't load: The A record may be pointing to the wrong IP.
  • Emails aren't arriving: The MX record is missing or incorrect.
  • Emails land in spam: SPF/DKIM TXT records are missing.
  • Changes don't show up: The TTL hasn't expired yet, or your browser cache needs to be cleared.

Frequently Asked Questions

How long does a DNS change take to go into effect?

Usually anywhere from a few minutes to a few hours. It can take up to 48 hours for all caches to fully refresh.

Where can I check my DNS records?

You can see your records by typing nslookup example.com in Command Prompt on Windows, or dig example.com on Linux or macOS.

Will using a different DNS resolver make my site faster?

It can make domain names resolve faster on your own connection, but it doesn't change the speed of the site itself.

Can I get my domain and hosting from different companies?

Yes. You just need to enter your hosting's IP address or nameservers in your domain's DNS settings.