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.
// Option A: nameservers ns1.yourhost.com ns2.yourhost.com // Option B: records @ A 203.0.113.10 www CNAME example.com.
🧰 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
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.
Save what you have
- Open your registrar's DNS page.
- Take a screenshot or copy every record into a note, especially MX and TXT records for email.
- 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.
Change nameservers
- Find the nameservers in your host's welcome email or dashboard.
- In your registrar account, open the domain and find Nameservers.
- Choose Custom nameservers and paste in your host's names, one per box.
- Save.
- Recreate your email records (MX, TXT) in your host's DNS settings, using the copy you saved.
Add DNS records
- Copy the IP address your host gives you.
- Edit the A record for @ so its value is that IP. If there isn't one, add it.
- Point www with a CNAME to your domain, or with an A record to the same IP, whichever your host says.
- Delete old A records for @ and www that point somewhere else, like a parking page.
- Save.
@ A 203.0.113.10
www CNAME example.com.
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
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.
Key takeaways
Keep going
- Check progress while you wait: Why DNS Changes Take Time
- Add a blog or shop address: Setting Up Subdomains
Enjoyed this guide?
Support free learning at mC0de.
