WHAT'S NEW
Domains & DNS · GuideGuides › Domains & DNS

Pointing a Domain at Your Host

Connect your domain to your web host the right way, using either new nameservers or a couple of DNS records.

📶 Beginner⏱ 8 min🗓 Updated November 17, 2026❤ 0
connect.txt
// Option A: nameservers
ns1.yourhost.com
ns2.yourhost.com

// Option B: records
@    A      203.0.113.10
www  CNAME  example.com.
// Before you start

🧰 What you need first

  • A domain at a registrar
  • A hosting account
  • The connection details from your host

🎯 What you'll learn

  • Choose between nameservers and DNS records
  • Make the change without breaking email
  • Check that it worked

🛠 Tools needed

  • Your registrar account
  • Your hosting account
01 / Start here

Two ways to connect

Your host gives you one of two things. Use whichever one they ask for:

  • Nameservers (like ns1.yourhost.com): your host manages all your DNS from now on.
  • DNS records (an IP address for an A record, sometimes a CNAME): your registrar keeps managing DNS, and you add just the website records.

Tip: records are the safer choice if your email already works, because nothing else changes.

02 / Before you start

Save what you have

  1. Open your registrar's DNS page.
  2. Take a screenshot or copy every record into a note, especially MX and TXT records for email.
  3. Lower the TTL on the A and CNAME records to 300 if you can, and wait a few hours.

Warning: switching nameservers replaces all your DNS records. If you skip this backup, your email can stop working.

03 / Option A

Change nameservers

  1. Find the nameservers in your host's welcome email or dashboard.
  2. In your registrar account, open the domain and find Nameservers.
  3. Choose Custom nameservers and paste in your host's names, one per box.
  4. Save.
  5. Recreate your email records (MX, TXT) in your host's DNS settings, using the copy you saved.
04 / Option B

Add DNS records

  1. Copy the IP address your host gives you.
  2. Edit the A record for @ so its value is that IP. If there isn't one, add it.
  3. Point www with a CNAME to your domain, or with an A record to the same IP, whichever your host says.
  4. Delete old A records for @ and www that point somewhere else, like a parking page.
  5. Save.
@    A      203.0.113.10
www  CNAME  example.com.
05 / Check

Did it work?

After a little while, check what the internet sees. Use the command for your computer, replacing example.com with your domain:

nslookup example.com

On a Mac you can also use:

dig example.com +short
  • The IP shown matches your host's IP
  • Both example.com and www.example.com open your site
  • Email still sends and arrives
06 / Help

Common problems

I see my registrar's parking page

Why: An old record still points to the parking page, or the change hasn't spread yet.
Fix: Delete the old parking records, then give it a few hours.

Email stopped after changing nameservers

Why: Your email records stayed at the old DNS.
Fix: Add the MX and TXT records from your backup to your host's DNS.

The site works but www doesn't

Why: There's no record for www.
Fix: Add a CNAME for www pointing to your domain, or the record your host provides.

"Your connection is not private"

Why: The SSL certificate is issued only after the domain points to the host.
Fix: Wait an hour, then turn on SSL in your hosting dashboard.

// Recap

Key takeaways

Nameservers hand all DNS to your host
Records keep DNS at your registrar and only point the website
Copy existing email records before switching nameservers
Wait, then check both example.com and www
// What's next

Keep going

Enjoyed this guide?

Support free learning at mC0de.

PIX0
</> {} JS 01
0101 </> CSS JS HTML PIX0 const {} 1010 async mC0de function return 0101 <div> 1010 PIX0 CSS JS HTML const {} 0101 mC0de
PIX0 // WORLD OF CODE
PIX0 IS PREPARING SOMETHING AWESOME FOR YOU 0%