In short. Connecting a domain to hosting means telling the domain's settings where the site physically lives. There are two ways: change the domain's NS servers to the host's servers (then the host manages all records — simpler for a beginner), or add an A record with the server's IP address directly (more flexible if you manage DNS separately). After the change you wait for DNS to update — usually from a few minutes to a few hours. You can confirm the connection worked by checking the domain's A record. Below are both methods step by step, how long to wait, and how to make sure it worked.
What actually happens when you connect
A domain and hosting are two separate things, often bought in different places. The domain is a name (example.com); hosting is the server where the site's files live, and it has an IP address. "Connecting" means linking the name to the address through DNS, so that a browser visiting the domain lands on the right server.
The domain is the address on the sign, the hosting is the building itself. Connecting a domain to hosting is the entry in the directory (DNS) that says: for this name, look at this IP.
Method 1. Change the NS servers (simpler)
The most common path for a beginner. You hand management of all the domain's DNS records to the host: at the registrar you change the domain's NS servers to the ones the host gave you (usually like ns1.host.com, ns2.host.com).
- In the hosting panel, find its NS servers (the "DNS," "Domains" section, or the connection instructions).
- In the domain registrar's dashboard, open the domain settings → "DNS servers" / "NS."
- Replace the current NS with the host's servers, save.
- In the hosting panel, add the domain as a site (this is often done automatically).
Upside: from then on all records (mail, subdomains) are configured in one hosting panel. Downside: an NS change propagates more slowly — sometimes up to a day.
Method 2. Add an A record (more flexible)
If you manage the domain's DNS separately (at the registrar or in a third-party DNS like a cloud one) without changing the NS, it's enough to point the needed records at the server's IP:
- Find the server's IP address in the hosting panel (or in the connection email).
- In the domain's DNS settings, create an A record: name
@(the domain itself) → the server's IP. - Add an A record for
wwwto the same IP (or a CNAMEwww→ the domain). - Save and wait for the update.
Upside: full control over DNS — you can keep mail with one provider and the site with another. Downside: you configure the records by hand. How A, CNAME, and other records work is in the DNS records guide.
How long to wait and how to check
After a DNS change, it doesn't update instantly: old values live in provider caches until the TTL expires. An A-record change is usually picked up in minutes to hours; an NS change takes longer, sometimes up to 24 hours. You can't speed it up, only check the progress.
# check which IP the domain currently points to:
dig +short example.com A
# should return your server's IP
Easier without a terminal — via a DNS lookup (to see the A record) or a DNS propagation check by region: it shows whether the new address is visible at every point. While some regions still return the old IP, propagation is still in progress.
Don't panic if the site doesn't open right after the change: it's almost always not a connection error but an unfinished DNS update. Check the A record — if it's already correct, all that's left is to wait for the caches to refresh.
Common mistakes
- Changed it in the wrong place. You switched NS at the registrar but edit records in the old DNS — they no longer apply. The DNS the NS points to is the one in charge.
- Forgot about
www. The domain opens butwww.domaindoesn't: there's no separate record forwww. - Waiting seconds instead of hours. "Doesn't work" right after the change is normal, not a breakage. Give DNS time.
- An old IP in another record. After a move, an A record pointing to the previous server remains — the site opens now here, now there.
Frequently asked questions
NS servers or an A record — which to choose?
If you're just starting and want to manage everything in one panel, change the NS to the host's servers. If you already manage DNS separately (say, domain and mail with one provider, the site with another), add an A record without touching the NS. Both work; the difference is who manages the records.
The domain and hosting are with different providers — is that a problem?
No, that's a common and normal situation. You can buy the domain in one place and hosting in another; connecting via NS or an A record is exactly what that's for. There's no obligation to keep them together.
I connected it, but the site won't open. What to check?
First the A record: dig +short example.com or a DNS lookup — does the domain point to the right IP? If yes and the site still won't open, wait for the DNS update and check that the domain is added as a site in the hosting panel. If the A record is wrong — fix it where DNS is actually managed (per the current NS).
Checklist to remember
- Connecting = linking the domain name to the server's IP through DNS.
- Two ways: change NS to the host's servers (simpler) or add an A record to the IP (more flexible).
- NS updates take longer (up to a day), an A record is faster (minutes to hours).
- Didn't open right away — almost always unfinished DNS, not an error; check the A record.
- Don't forget a separate record for
www.