LESSON 11.4

Nameservers and DNS

Connect your domain name to your hosting server

Learn what nameservers are, how to point your domain to your hosting provider, and how DNS propagation works.

💡 The Concept

Nameservers and DNS are the systems that connect a domain name to a hosting server, routing visitors to the right place. After you purchase a domain name and a hosting plan, you need to connect the two. That connection is made through nameservers.

What Are Nameservers?

A nameserver is a server that stores the DNS (Domain Name System) records for your domain. When someone types your domain into a browser, the internet uses your nameservers to look up which hosting server your site lives on. Think of nameservers as the address book that points your domain to the right place.

Every hosting provider has nameservers that look something like this:

ns1.yourhostingcompany.com
ns2.yourhostingcompany.com

You can find your nameservers in your hosting account control panel, usually listed under Account Info, Hosting Details, or DNS. It looks similar to this on almost all domain registrars:

Screenshot of the screen used to set the name servers on a website.

How to Point Your Domain to Your Host

  1. Log in to your hosting account and locate your nameservers. Copy both of them.
  2. Log in to your domain registrar (Hover, Namecheap, etc.).
  3. Find the DNS or Nameserver settings for your domain.
  4. Replace the existing nameservers with the ones from your hosting account.
  5. Save the changes.
Diagram of how the DNS servers resolve the domain name and send it to the website visitor.

The A Record: An Alternative Approach

Changing nameservers hands all DNS management over to your hosting provider. Sometimes you may want to keep DNS management at your registrar and just point your domain to a specific server. That is what an A record does.

An A record (Address record) maps your domain directly to an IP address. Instead of updating nameservers, you leave them as-is and add or edit an A record that points to your hosting server’s IP address. Your host’s control panel will list the IP address you need, usually under Account Info or Hosting Details.

This approach is especially useful when your client already has email set up through a separate provider. Changing nameservers can disrupt existing email; updating only the A record avoids that risk.

Setting Up Email DNS

Website hosting and email hosting are separate services. Your domain needs to know where to deliver email, and that is handled by MX records (Mail Exchange records). MX records tell the internet which server handles email for your domain.

If your hosting provider includes email, your nameservers usually handle this automatically. But if your client uses a separate email service like Google Workspace or Microsoft 365, you will need to add that provider’s MX records to your DNS settings. Each email provider gives you the exact records to enter.

This is one more reason to ask about email before changing any DNS settings for a client. If email is already working, you want to make sure it keeps working after the switch.

DNS Propagation

After you update your nameservers, the change does not take effect instantly. DNS records have to spread to servers all over the internet, a process called DNS propagation. This can take anywhere from a few minutes to 48 hours.

The most common sign that propagation is still in progress: your domain shows an error or a blank page even though your files are uploaded correctly. This is normal. Give it time and check again later.

Frequently Asked Questions

My DNS change does not seem to be working. What should I do?

First, use a tool like whatsmydns.net to check whether the change has propagated. In practice, DNS rarely takes the full 48 hours — it usually shows up within minutes to an hour. If an hour has passed and it still is not showing up, you most likely have a typo in your nameservers or A record. Go back and double-check what you entered. Another trick: try switching your internet connection. Some ISPs pick up DNS changes faster than others.

Will changing my nameservers affect my client’s email?

It can. If your client’s email is managed by a separate provider like Google Workspace or Microsoft 365, changing nameservers may wipe out the MX records that keep email running. Always ask about email before touching DNS settings. If email is already working, updating only the A record is the safer move.

When should I use an A record instead of changing nameservers?

Use an A record when you want to keep DNS management at the domain registrar, or when the client already has email set up that you do not want to disturb. Use nameservers when you want the hosting provider to manage all DNS, which is simpler for straightforward setups with no existing email.

Why are there two nameservers?

Hosting providers give you two nameservers for redundancy. If the first one is temporarily unreachable, the second one takes over. You need to enter both when updating your domain settings.

Key Takeaways

When you type a web address, something has to connect that name to a real server. This lesson explained how nameservers and DNS make that connection happen behind the scenes. Next, you will learn about FTP, the tool developers use to transfer their files up to a web server. It is a key skill for managing a live website.

Google Ads

The costs of this website are partially offset by revenue from Google Ads.

Tools of the Trade

HTML/CSS Lessons