How DNS & hosting fit together

Learn how your domain name connects to your hosting server through DNS, and why this matters when making changes to your site.

Time
4 min read
Difficulty
Beginner
Last updated
Updated
Share

Your domain name and your hosting are two separate things, but they have to be connected for your website to work. That connection is made through something called DNS. Understanding how this works will save you a lot of confusion.

The three things that make a website work

Most websites involve three separate services:

  1. Domain registrar: where you registered and own your domain name (e.g. GoDaddy, Namecheap, Cloudflare).
  2. DNS provider: manages the records that tell the internet where to send requests for your domain. Often the same as your registrar, sometimes separate (e.g. if you use Cloudflare for DNS).
  3. Hosting provider: the server where your website's files actually live (e.g. Flywheel, WP Engine, Kinsta).

All three must be configured correctly for your site to appear when someone types your address.

How DNS connects your domain to your hosting

When someone types yourbusiness.com in their browser, here's what happens in order:

The browser asks a DNS server: "Where is yourbusiness.com?"

The DNS server looks up your A record: a record that maps your domain to a specific IP address (the address of your hosting server).

The browser connects to that IP address. Your hosting server receives the request.

The server sends back your website's files, and the browser displays your page.

This all happens very quickly. The DNS answer is cached (saved) for a set time, called the TTL (time to live), so the lookup doesn't happen for every single request.

How a DNS lookup finds your websiteA browser asks a DNS resolver where a domain lives, the resolver asks the domain's nameservers, the answer comes back and is cached, and the browser then connects straight to that address.where is it?passes it onthe IP addressconnects1234Visitor's browsertypes yourbusiness.comCACHESDNS resolverremembers, for the TTLYour nameservershold your DNS recordsYour web server185.199.108.153

Four hops, all of them in milliseconds. The resolver is the one that remembers, which is why a record you changed this morning can still be invisible to some visitors this afternoon, until its TTL expires.

Read this as text

When somebody types your domain, their browser does not know where your site is. It asks a DNS resolver, run by their internet provider, or by a service like Cloudflare or Google.

If the resolver does not already know the answer, it asks your domain’s authoritative nameservers, which hold the official records for your domain. They reply with the IP address, for example 185.199.108.153.

The browser then connects straight to that address and your site loads. The nameservers are not involved again.

The resolver keeps that answer for a set period, the TTL. Until it expires, that resolver keeps handing out the old answer without asking your nameservers again, which is the whole reason a DNS change can take minutes for one person and hours for another.

The DNS records that matter most for hosting

Record typeWhat it does
A recordPoints your domain name to your server's IPv4 address. This is the most important record for hosting. (The IPv6 equivalent is the AAAA record.)
CNAME recordPoints one domain name to another (e.g. www.yourbusiness.com → yourbusiness.com).
MX recordPoints your domain to your email provider. Has nothing to do with hosting, but easy to accidentally affect when making DNS changes.
TXT recordHolds text data: used for email security (SPF, DKIM) and domain verification.

Don't change MX records when updating hosting

Email uses separate DNS records (MX records) from your website. If you're changing hosting, don't touch the MX records. See hosting vs email: why they're separate.

What happens to DNS when you change hosts

If you move to a new hosting provider, we need to update your DNS records to point to the new server. Here's the process:

We set up your site on the new host. Everything is tested before DNS changes.

We update your DNS records to point to the new server. This is usually the A record, which holds the server's IP address, and often a CNAME record for the www version of your domain.

DNS propagation begins. This is the period while DNS servers around the world refresh their saved copies of your records. It's often done within a few hours, but it can take up to 48 hours. How long depends on each record's TTL setting.

During propagation, some visitors may see the old site and some may see the new one, depending on which DNS server they're using.

Propagation completes and all visitors see the new site.

Nameservers vs individual DNS records

There are two ways to manage your DNS:

  • Using your registrar's nameservers: you update individual DNS records (A, CNAME, MX, TXT) through your registrar's control panel.
  • Delegating to another provider's nameservers (e.g. Cloudflare): the other provider manages all your DNS records. Providers like Cloudflare can scan for your existing records and import them, but the scan isn't guaranteed to find them all, so every record has to be checked before you switch. Email records especially, or email can break.

We'll handle this for you and explain which approach we're using for your site. See domains & DNS for a deeper explanation.

Common questions

Why does my site look different on different devices right after a change?

DNS propagation means different devices get the updated records at slightly different times. This is normal. It usually settles within a few hours, though it can take up to 48 hours.

Can I use a different registrar and hosting provider?

Yes, absolutely. Your registrar (where you bought the domain) and your hosting provider are completely separate. Most of our clients use one for the domain and another for hosting.

Will changing hosting affect my email?

Only if we accidentally change the wrong DNS records. We're careful to preserve your MX records during any hosting migration. See hosting vs email.

What does 'DNS propagation' mean in practice?

It means DNS servers around the world, such as those run by internet providers, are refreshing their saved copies of your records. Each one does this on its own schedule, so there's nothing to do but wait. It's often done within a few hours. See DNS propagation.

Was this page helpful?

Go deeper on chykalophia.com

Need a hand?

Stuck? We'll help.

Email us with your website address and a screenshot if you can, and we’ll take it from there.

Last updated