ZEROLAG

The right name for your project

Find a domain and check its availability with ZEROLAG.

Give your project a name.

Enter a domain name to check its availability.

How to connect a domain to cPanel hosting: DNS, website and email setup

The connection between the domain, DNS and website.
Back to articles
Article contents

Bought a domain and a hosting plan but still can’t open your website? In most cases the site itself is fine. The domain simply isn’t pointing to the hosting account yet.

To be simple: the domain is the address of your website, hosting is where the site files are located, and DNS is the link between them. If the DNS is not set correctly, the domain may exist, hosting may be active, but visitors still do not reach the site.

In this guide we explain step by step how you connect a domain to the host of cPanel, which is automatically configured, what you need to do manually and what you check for the website, email and SSL to work properly.

Domain setup at a glance

For the simplest setup with cPanel hosting, set the domain’s nameservers to the ones supplied by your hosting provider. After that, the domain DNS will be managed by the hosting server, and in cPanel you can check or change the records in Zone Editor.

If you use Cloudflare or other external DNS, you do not modify the DNS in cPanel, but in Cloudflare or in the panel where the active nameservers are. In that case, you must manually set the important records: A for the site, CNAME for www, MX for email and TXT for SPF, DKIM, DMARC or external checks.

1. Understand the difference: domain, hosting and DNS

Before you change anything, you need to know the role of each piece.

Item What does that mean? Simple example
Domain The address people write in their browser. exemplu.ro
Hosting The server where the site files are located, the database and sometimes emails. Your cPanel hosting account
DNS The system that says where to send the domain. A, CNAME, MX, TXT
Nameserere Servers that decide where the domain DNS is administered. ns1.zerolag.ro, ns2.zerolag.ro

Think of it this way: the domain is the address, the hosting is the house, and the DNS is the map that says where the house is.

2. The simplest case: the domain and hosting are at the same supplier

If you have the domain and hosting administered in the same place, the configuration is usually the simplest. In many cases, the nameservers are set correctly from the start or can be applied quickly by the supplier.

When the hosting account is created on cPanel / WHM, the server prepares the DNS zone for the domain. This means that the basic records for the site, email and usual services can be created automatically on the server.

What does that mean to you?

  • you do not have to manually create all DNS records from scratch;
  • the DNS zone of the domain already exists on the hosting server;
  • in cPanel you can check the records in Zone Editor;
  • The SSL can be activated after the domain points to the server;
  • The email works if the MX records are correct.

For an ordinary customer, that means less technical work. Normally, the important part is that the domain uses the right nameservers.

3. When your domain is registered elsewhere

If you bought the domain from another registries, and the hosting is at ZEROLAG, you have to link the domain to your hosting account.

You have two choices:

Variant When you choose it What are you doing concrete?
Change the nameservers You want the DNS managed by hosting / cPanel. You're setting up the registries for your ZEROLAG servers.
You keep the external DNS You use Cloudflare or other DNS service. You manually add the A, CNAME, MX and TXT records to that external DNS.

For most customers, the nameserere version is simpler. For more advanced users, Cloudflare or external DNS offers more control but more responsibility.

4. The simplest option: use your hosting provider’s nameservers

This is the recommended method if you want to manage DNS directly from cPanel and you have no special settings in Cloudflare, Google Workspace, Microsoft 365 or other external services.

In the panel where you bought the domain, search for the nameservers section and set up the nameservers received from the hosting provider.

Example:

ns1.zerolag.ro
ns2.zerolag.ro

Simple steps

  1. enter into the account where you bought the domain;
  2. look for the section Nameservers, DNS or DNS Servers;
  3. choose the option for custom nameservers;
  4. Enter the nameservers received from hosting;
  5. save the change;
  6. wait for the propagation of DNS;
  7. check if the site opens;
  8. You're checking the SSLL in cPanel.

After this change, the domain DNS will be managed by the hosting server. That means the major changes are made from cPanel at Zone Editor.

5. How to check DNS in cPanel

After the domain uses the hosting nameservers, you can check the DNS zone in cPanel.

Steps in cPanel

  1. enter the cPanel;
  2. go to the section Domains;
  3. Open Editor areas;
  4. find your domain in the list;
  5. press Manage;
  6. verify existing records;
  7. Just change the records that you understand.

Zone Editor is where you can manage records such as A, CNAME, MX and TXT. For most customers, these are important records for the website, email and external checks.

6. The A record: where the main domain points

The A record is the one that links the domain to the server's IP. If the domain has to open the site on your hosting account, the A record has to point to the correct IP.

Example:

exemplu.ro.     A     192.0.2.10

In many cPanel accounts, this record is created automatically when the account is created. You only need to modify it if you move the site to another server, use external DNS or have been given clear instructions from the provider.

When does A record have to be modified?

  • when the domain is in Cloudflare and you must send it to hosting;
  • when you moved the site to another server;
  • when the provider gave you a new IP;
  • When you have a subdomain that has to lead to another server.

If you use the DNS in cPanel and everything is created automatically, you don't usually have to go to A record.

7. CNAME record: how to configure www

Many visitors write the site in the browser with wwwfor example www.exemplu.ro. Therefore, you need to make sure that both the main domain and the option of www.

A common configuration is:

www     CNAME     exemplu.ro

That means www.exemplu.ro follow the main domain exemplu.ro.

If the main domain leads to the server's IP, www is CNAME to the main domain, both variants should open the same site.

8. MX records: where email goes

The email is the part where most mistakes occur. The site and email can be hosted in different places.

MX records say where the emails are supposed to go for your domain. If the email is hosted in cPanel, the MX usually points to the hosting server. If you use Google Workspace, Microsoft 365 or other external service, the MX must remain at that service.

Simple example

Situation What are you doing with MX?
Email in cPanel Use the MX generated by hosting / cPanel.
Email to Google Workspace You keep Google MXs.
Email to Microsoft 365 You keep Microsoft MXs.
You don't know where the email is Don't change the MX until you check.

If you change the nameservers to hosting and the email was with another provider, you must also copy the email records in the new DNS zone. Otherwise, the site may work, but the email may not receive any more messages.

9. TXT records: SPF, DKIM, DMARC and checks

TXT records are used for checking and authentication of the email. Don't erase them without knowing what they're doing.

TXT Record Role
SPF Tell which servers are allowed to email for the domain.
DKIM Sign the e-mails you sent so they can be checked.
DMARC Say what policy applies if SPF or DKIM do not pass the check.
External checks Google Search Console, Microsoft, email services, SaaS platforms.

If you move the DNS from one provider to another, write down existing TXT records. Some seem unimportant, but can be used for email or external checks.

10. If you use Cloudflare, change the DNS in Cloudflare

Cloudflare is a very common case. If the domain uses Cloudflare nameservers, then the public DNS is in Cloudflare, not in cPanel.

In this case, even if there is a DNS zone in the panel for the domain, changes made in cPanel will not be used publicly. You need to get into Cloudflare and change the records there.

Minimum site configuration in Cloudflare

Type Name Value Role
A @ The IP of the hosting server Points the main domain to the hosting server.
CNAME www exemplu.ro Duke www to the main domain.

For email, you must also copy the required MX / TXT records. If you don't copy them, the site can work, but the email can be affected.

11. SSL works after DNS points to server

The SSL certificate cannot be issued correctly unless the domain points to the right server. That's why sometimes the SSL doesn't show up right after you bought hosting.

First, the domain must resolve to the server’s IP address. After that, AutoSSL can validate the domain and issue the certificate.

Check in cPanel

  1. enter the cPanel;
  2. go to SSL / TLS Status;
  3. verify the main domain; and www;
  4. if AutoSSL problem occurs, check the DNS;
  5. After the propagation, run AutoSSL again if necessary.

If the domain still leads to another server, AutoSSL can fail. It's not necessarily a problem with the certificate, it's the DNS.

12. What is DNS propagation?

Propagation of DNS is the time it takes for changes in DNS to be seen by different networks and resolvers. Sometimes change is seen in a few minutes, sometimes it lasts longer.

This is because of the DNS cache. The Internet does not always directly ask the authoritative DNS server, but can use temporarily stored information.

What do you do after changing the nameservers?

  • wait for propagation;
  • do not change settings more than once at random;
  • check that the nameservers are the right ones;
  • Test the main domain and variant www;
  • check the email after the change;
  • activate / check the SSL after the domain points to the server.

If you make many changes at the same time, it becomes hard to figure out which setting has produced the problem.

13. What if the website works but email doesn’t?

If the site opens, but the email doesn't work, the problem is usually with MX or TXT email records.

Check these things out:

  • where the email is hosted: cPanel, Google, Microsoft or other provider;
  • whether MX records are correct;
  • if there is a SPF, DKIM and DMARC;
  • if you copied the old records after changing the nameservers;
  • if Email Routing in cPanel is set correctly.

Do not assume that the email is automatically in the same place as the website. Many companies have the website at one provider and the email at another.

14. What are glue records and when do you need them?

Glue records are only required in special situations, when you use your own nameservers under the same domain.

Example:

Domeniu: exemplu.ro
Nameservere: ns1.exemplu.ro și ns2.exemplu.ro

For these nameservers to work, the registry needs to know their IPs. Those associates are glue records.

If you use your hosting provider's nameservers or Cloudflare, you don't usually need glue records.

15. Common mistakes when connecting the domain to hosting

  • Modify the DNS in cPanel, but the domain uses Cloudflare;
  • change your nameservers and forget to copy your email records;
  • you just set the main domain, but forget about www;
  • delete TXT records for SPF, DKIM or DMARC;
  • you expect the SSL to work before the DNS is propagated;
  • change MX without knowing where the email is hosted;
  • you make multiple DNS changes at random;
  • you don't check if the domain uses the right nameservers.

16. Domain setup checklist

If you want to connect a domain to the cPanel hosting, check the following:

  • you know where the domain is bought;
  • You know where the site is hosted;
  • you know where the email is hosted;
  • you have the nameservers received from hosting;
  • you've decided if you're using the DNS in cPanel or Cloudflare;
  • if you're using cPanel DNS, you've set the hosting provider’s nameservers;
  • if you use Cloudflare, you set A record to the server's IP;
  • you have configured and www;
  • you checked MX for email;
  • you kept SPF, DKIM and DMARC;
  • you waited for the propagation of DNS;
  • You checked the SLL in cPanel.

17. Final recommendation

For most customers, the simplest option is to set the nameservers of the hosting provider. In this way, the DNS zone is managed from cPanel, and many basic records are already automatically prepared.

If you use Cloudflare or other external DNS, it's perfectly fine, but you need to know that the DNS changes are made there, not in cPanel. In that case, you have to manually set the records for the site, www, e-mail and checks.

Before changing DNS, find out who manages the nameservers, where your site is hosted and where your email is delivered. Once you know those three things, connecting the domain is much simpler.

Choose the next step
for your project.

Explore the relevant service or discuss your requirements with us.

Explore your options