Connect a domain to hosting or a server
After you register a domain and activate your hosting, the internet doesn't automatically know that this domain belongs to that hosting. You need to make the domain point to it, in one of two ways:
- Change the name servers (NS): this moves management of all the domain's records to the new provider. It's the recommended method for shared hosting, because cPanel then creates the website and email records automatically.
- Add A and CNAME records: this keeps your records with your current provider and only changes where the website points, to the IP address of the hosting or server. It's the usual method for VPS servers, and for anyone who wants to keep their email with another provider.
First find out where your domain's records are currently managed: they are with whichever provider the domain's current name servers point to. Changing records anywhere else will have no effect.
Recommended method: the hosting name servers
Open the hosting activation message from the Instructions button on the Shared Hosting page, and copy the name servers listed in the Name server section.
Make sure the domain has been added to the hosting account: the domain you entered when ordering the hosting is added automatically as the primary domain, and you can add any extra domain from the Domains interface in cPanel.
Change the domain's name servers to the ones you copied:
- If the domain is registered with Illevante: from the NS page.
- If it's registered elsewhere: from that provider's control panel, in the section for name servers (Nameservers).
Wait for propagation. The activation message notes that the domain may take from 2 to 24 hours to start working, and a name server change can sometimes take up to 48 hours.
When you change the name servers, the hosting zone's records become the authoritative ones, including the MX records that route email to the hosting. If you use email with another provider, add that provider's MX and TXT records in the Zone Editor in cPanel before you change the name servers, or immediately after.
Alternative: an A record only
If you'd rather keep your records with your current provider, add the following there:
- An A record for the domain itself (
@) pointing to the server IP address given in the activation message. - A CNAME record for
wwwpointing toexample.com(or a second A record with the same address).
The IP address of shared hosting may change for technical reasons. With this method, your record won't update automatically, and your website may stop working until you edit it manually. That's why the activation message recommends using Illevante's name servers.
Check the result
After making the change, check what DNS returns for your domain using one of the following commands (replace example.com with your domain):
nslookup example.comdig example.com +short
dig NS example.com +short- The first command should return the IP address of your hosting or server.
- The
dig NScommand should return the new name servers if you changed them.
If you see the old result, the change hasn't yet reached the server you're asking. See DNS propagation and how to check it.
Common issues
This is normal during DNS propagation: your internet provider or your device may be holding on to the old answer. Wait a few hours, and try from another network (such as mobile data) or after clearing your device's DNS cache.
One of the two records is missing. Add an A or CNAME record for the missing name as described in the steps above.
The domain is working, but there's no valid SSL certificate for it yet. On shared hosting, AutoSSL issues the free certificate once the domain starts pointing to the hosting, and you can speed this up as described in Free SSL certificates (AutoSSL). On a VPS, you need to install a certificate yourself.
The MX records at the new provider don't point to your mail server. Add the correct MX and SPF records with the provider your name servers now point to. You'll find the values you need in the article on email DNS records in the DNS section.
How is this guide?