
You have a domain at one company and hosting at another, and the website still shows a "parked" page. To connect them, you tell the domain where your hosting lives. There are two ways to do it: change the nameservers, or keep your DNS where it is and add an A record. This guide explains when to use each, walks through both step by step, and shows how to check that the change worked.
cPanel screenshots are from a real account (Jupiter theme). Domain names and IP addresses are replaced with example values.
Nameservers or A record – which one should you use?
| Change nameservers | Add an A record | |
|---|---|---|
| What it does | Hands the whole DNS of the domain to your hosting | Points only the website (and any subdomains you add) to the hosting server |
| Email (MX) | Handled by the hosting's DNS | Stays wherever it is now |
| Who manages records | Your hosting – cPanel creates them for you | You, at your registrar or DNS provider |
| Best for | Most websites – the simplest choice | Domains on Cloudflare, or when email (Google Workspace, Microsoft 365) or other services must stay put |
Rule of thumb: if your website and email are both going to the new hosting, change the nameservers. If you only want to move the website, or you use Cloudflare, use an A record.
Before you start: find your nameservers and server IP
- Nameservers – your hosting company sends them in the welcome email when the account is created. They look like
ns1.yourhost.comandns2.yourhost.com. XMart Host customers also find them in the welcome email in the client area. - Server IP address – needed for the A record method. In cPanel, it is shown on the home page under General Information → Shared IP Address.
One more thing to check first: the domain must be added in cPanel. The main domain of the account is added automatically. For an extra domain, add it in cPanel → Domains → Create a New Domain, otherwise the server won't know which folder to serve.
Method 1: Change the nameservers
You change nameservers where the domain is registered (the registrar), not at the hosting. The menu names differ, but the steps are always the same:
- Log in to your registrar and open the domain list.
- Open the domain and find Nameservers (sometimes under "DNS" or "Manage DNS").
- Choose the option to use custom nameservers (not the registrar's default or "parking" nameservers).
- Enter
ns1…andns2…from your hosting exactly, with nohttp://and no trailing dot. Delete any old extra nameservers. - Save. Most registrars show a confirmation that the change was sent to the registry.
Where to find it at common registrars
| Registrar | Path |
|---|---|
| XMart Host client area | Domains → My Domains → the domain → Nameservers → "Use custom nameservers" |
| GoDaddy | Domain Portfolio → the domain → DNS → Nameservers → Change → "I'll use my own nameservers" |
| Namecheap | Domain List → Manage → Nameservers → "Custom DNS" |
| Cloudflare Registrar | Domains registered here must use Cloudflare's nameservers – use Method 2 (A record) instead |
| .pk domains | Changed through the company that registered the .pk at PKNIC – see our .pk domain guide |
Important: DNSSEC
If DNSSEC is switched on at the registrar for the old DNS provider, turn it off (remove the DS record) before you change nameservers. Otherwise resolvers that check DNSSEC reject the answers from the new nameservers, and the domain stops resolving for many visitors with a "SERVFAIL" error. You can switch DNSSEC on again for the new provider later.
Don't lose your email
With new nameservers, email follows the hosting's DNS. If your mailboxes stay on Google Workspace or Microsoft 365, add their MX and TXT (SPF) records in cPanel → Zone Editor before you switch, or email will start arriving at the hosting server instead. In cPanel → Email Routing, set the domain to Remote Mail Exchanger so the server doesn't try to deliver it locally.
Method 2: Add or edit the A record
Use this when you keep your current DNS – at the registrar, or at Cloudflare. You only change the records that matter for the website:
| Type | Name / Host | Value | TTL |
|---|---|---|---|
| A | @ (the domain itself) | Your server IP, e.g. 203.0.113.10 | Auto or 1 hour |
| CNAME | www | example.com (your domain) | Auto or 1 hour |
- Open the DNS settings of the domain at your DNS provider.
- Edit the existing A record for
@rather than adding a second one. Two A records with different IPs send half the visitors to the old server. - Delete any AAAA (IPv6) record that still points to the old host – browsers often try IPv6 first.
- Remove "forwarding" or "parking" records the registrar added for
@orwww. - Save and wait for the old TTL to expire (often 1–4 hours).
This is what correct A records look like in cPanel's Zone Editor – the domain and its mail, ftp and webmail names all point to the server IP:
Tip for a smooth move: a day before you switch, lower the TTL of the old records to 300 seconds. When you change the IP, visitors pick up the new address in minutes instead of hours.
Using Cloudflare
If the domain's nameservers are at Cloudflare, leave them there and work in Cloudflare → DNS → Records:
- Set the
@A record and thewwwrecord to your hosting IP. The orange cloud (proxied) is fine for the website. - Keep
mail,ftp,cpanelandwebmailrecords on DNS only (grey cloud). Email and cPanel don't work through the proxy. - After your hosting has issued its SSL certificate, set Cloudflare → SSL/TLS to Full (strict). "Flexible" causes redirect loops on most WordPress sites.
How to check that it worked
Don't trust your own browser alone – it and your computer cache old answers. Ask DNS directly:
# Which nameservers does the world see?
nslookup -type=ns example.com 8.8.8.8
# Which IP does the website point to?
nslookup example.com 1.1.1.1
# On macOS / Linux
dig NS example.com +short
dig A example.com @8.8.8.8 +short
When the nameservers or the IP in the answer are the new ones, the change is live for that resolver. An online checker such as whatsmydns.net shows the result from many countries at once. Nameserver changes for .com usually spread within a few hours, but allow up to 24–48 hours. If it seems stuck, follow DNS propagation not working.
After the domain points to your hosting
- SSL: cPanel's AutoSSL issues a free certificate once the domain resolves to the server – usually within a few hours. You can start it by hand in cPanel → SSL/TLS Status → Run AutoSSL. Problems? See SSL / HTTPS not working.
- Website: upload your files, or install WordPress in cPanel.
- Email: create mailboxes and connect them to your phone and computer – see set up cPanel email in Gmail, Outlook and iPhone.
Common mistakes
- Wrong nameservers – a typo, or the hosting company's old pair. Copy them from the welcome email.
- Changing DNS at the wrong place – editing records at the registrar while the nameservers point to Cloudflare (or the other way round) changes nothing. Edit records wherever the nameservers point.
- "www" forgotten –
example.comworks butwww.example.comdoesn't. Add the www CNAME. - Old AAAA record – some visitors still reach the old server over IPv6.
- Domain not added in cPanel – the server shows a default page instead of your site. See 404, subdomain and addon domain problems.
- Expired domain – an expired domain won't resolve, whatever the DNS says. See domain suspended or expired.
Frequently asked questions
How long does it take for a domain to point to new hosting?
An A record change is usually live within the old record's TTL – minutes to a few hours. A nameserver change usually takes a few hours but can take up to 24–48 hours worldwide.
Can I point a domain to hosting without changing the nameservers?
Yes – that is Method 2. Set the A record for @ to your server IP and the www CNAME to the domain at your current DNS provider.
Will my email stop working?
Not with an A record change – MX records stay as they are. With a nameserver change, email moves to the hosting's DNS, so copy your MX records into cPanel first if your email is hosted elsewhere.
Can a subdomain point to a different server?
Yes. Add an A record for the subdomain (for example shop) with the other server's IP. The rest of the domain is not affected.
Do I need to move the domain registration to my hosting company?
No. Pointing and transferring are different things. You can keep the domain at any registrar and point it anywhere. Keeping domain and hosting in one place just means one bill and one support team – see domain transfer if you want that.
Want it done for you? With XMart Host web hosting our 24/7 support team helps you point your domain and set up SSL and email, and we move your existing website for free. Need a new name? Register a domain and it is connected automatically.
