Skip to content
Domains

How to Point a Domain to Your Hosting: DNS Made Simple

In this article11 sections

To point a domain to your hosting, you have two options: change the domain’s nameservers at your registrar to the ones your host gave you, or keep your DNS where it is and add an A record that points to your hosting server’s IP address. Nameservers are the simpler choice, and they let you manage every DNS record from cPanel, so use them unless another service already handles your email or website traffic. After you save the change, it takes from a few minutes to about 48 hours to reach everyone.

This guide is written for people who bought a domain from one company and hosting from another, or who are moving a domain to cPanel hosting for the first time. If you also need to move an existing website, read how to move a WordPress site to a new host without downtime first, because the order of the steps matters.

What DNS does, in plain words

A domain name such as example.com is only a label. Computers find websites by number, and DNS (the Domain Name System) is the directory that connects the label to the number. When someone types your domain, their device asks DNS which server holds your site, and DNS answers with the server’s IP address.

Two things control that answer. The nameservers say which company holds the directory entries for your domain. The records inside that directory, such as the A record, say where each name points. Pointing a domain to your hosting means changing one of those two things so the answer becomes your hosting server.

Before you start

Collect three things before you change anything:

  • Your registrar login. This is the company where you bought the domain.
  • The details from your hosting welcome email. It lists the nameservers (usually two names that start with ns1 and ns2) and the server IP address.
  • The domain added in cPanel. If the domain is not set up in your hosting account, the server will not know what to show for it. For your main domain this is done when the account is created. For another domain, open Domains in cPanel and add it.

Warning. If your domain already runs a live website or email, read the email section below before you change anything. Switching nameservers replaces all the records at the old provider, and anything you do not recreate stops working.

Option 1: Change the nameservers

This hands control of the domain’s DNS to your hosting company. It is the best choice for most customers because every record can then be edited in one place, in cPanel.

  1. Log in to your registrar and open the list of your domains.
  2. Select the domain and look for a section called Nameservers or DNS.
  3. Choose the option for custom nameservers. The wording differs between registrars.
  4. Replace the existing nameservers with the two from your welcome email. Delete any extra ones.
  5. Save the change.

Registrars may show a short confirmation, and some send an email to approve it. Check your inbox, including the spam folder, because without the approval the change may not be applied.

Once the nameservers are active, open Zone Editor in cPanel to see the domain’s records. A record for the domain and one for www are normally created for you.

Option 2: Add an A record and keep your DNS where it is

Use this option when something else depends on your current DNS, for example email with another provider or a service that needs its own records. You leave the nameservers alone and only change where the website points.

  1. Find your server IP address. In cPanel, look at General Information on the right side of the home screen for the shared IP address. It is also in your welcome email.
  2. Log in to the DNS settings where your nameservers currently point, which is usually your registrar.
  3. Find the A record for the root of the domain. It is shown as @ or as the domain name. Change its value to your server IP address. If it does not exist, create it.
  4. Check the www record. It can be an A record with the same IP address, or a CNAME record that points to your domain. Either works, but do not leave it pointing to the old server.
  5. Save the changes.

Tip. Do not delete MX records or TXT records while you do this. They belong to email and verification services and have nothing to do with where the website points.

Protect your email

Email is the most common thing that breaks during a DNS change. Email delivery is controlled by MX records, and they live in the same place as the other records. If you switch nameservers, the MX records at the old provider stop being used.

  • If your email is with your new hosting: it will work after the nameservers change, because cPanel creates the MX records for you. Create your mailboxes in Email Accounts first.
  • If your email is with a different provider such as Google Workspace or Microsoft 365: copy every MX record and every TXT record related to email from the old DNS before you change nameservers, then add the same records in cPanel’s Zone Editor. Or use Option 2, which leaves them in place.

How long it takes, and how to check

DNS changes are not instant, because other networks keep a copy of the old answer until its timer, called TTL, runs out. Many changes show up within an hour or two. A nameserver change can take up to about 48 hours to be seen everywhere, so some visitors may see the new site while others still see the old one for a while.

To see what your device receives, run one of these commands in a terminal or command prompt, using your own domain:

nslookup example.com
dig +short example.com

The first works on Windows, macOS and Linux. The second works on macOS and Linux. The result should show your hosting server’s IP address. For a view from many places at once, enter the domain at dnschecker.org. If some locations show the old address and others the new one, the change is still spreading.

Check the SSL certificate

Browsers show a security warning for a domain that has no valid certificate. Hosting accounts usually issue free certificates automatically, but the domain must already point to the server before the certificate can be issued. After the change spreads, give it a few hours. If the warning remains, open SSL/TLS Status in cPanel, select the domain and run AutoSSL.

Common problems and fixes

  • You still see the old website. Either the change has not spread yet or your device remembers the old answer. Wait, then try a private window, another device or mobile data instead of your Wi-Fi.
  • You see a default server page or a 404 error. The domain points to the right server, but it is not added in cPanel. Add it under Domains.
  • The site loads without www but not with it, or the other way round. One of the two records is missing or still points to the old server. Check both in the DNS settings.
  • Email stopped working. The MX records were not recreated. Add them in the Zone Editor.
  • Your changes do not appear after a day. Confirm that you changed the DNS at the place the domain’s nameservers point to. If the nameservers are at your registrar, editing records in a different panel has no effect.

Common mistakes to avoid

  • Editing records at the wrong place. Only the provider listed in the domain’s nameservers controls its records.
  • Changing nameservers before checking email. Recreate your email records first.
  • Typing the IP address incorrectly. One wrong digit sends visitors to someone else’s server. Copy and paste it.
  • Cancelling the old hosting too early. Keep it for a few days until you are sure the change has spread.
  • Judging the result in the first hour. Test again later and from a different network.

Ready to host your domain?

If you have a domain and want a simple place to host it, our shared hosting plans include cPanel, and our support team can help you find the right nameservers or IP address. To make the site fast after it goes live, follow our 5-step WordPress speed guide.

Related guides: transferring a domain without downtime, setting up DMARC without losing email and migrating email to a new host with imapsync.

Frequently asked questions

Should I use nameservers or an A record?

Use nameservers if your hosting company will manage everything for the domain. Use an A record if your email or other services depend on your current DNS and you only want the website to move.

How long does it take for the domain to work?

Often within an hour or two, but it can take up to about 48 hours. The old TTL value decides how long other networks keep the old answer.

Will my website go down during the change?

Not if the new hosting already contains a working copy of the site. Visitors are sent to the new server as the change spreads, and until then they still reach the old one.

Do I need to transfer my domain to my host?

No. You can keep the domain at your registrar and only point it at your hosting. A transfer is a separate decision about where you manage and renew the domain.

Why does my domain work on my phone but not on my computer?

Your computer or router may still remember the old answer. Wait for the old TTL to run out, restart the router, or try a different network to confirm.

The short version: collect your nameservers and IP address, add the domain in cPanel, change either the nameservers or the A record, protect your email records, and check with nslookup or dnschecker.org while the change spreads.

Share this guide