How to Connect Domain to Hosting: Nameservers vs A Record Guide
Bought a domain and hosting from different companies? Learn both ways to connect them, how long DNS takes, and how to fix a domain that will not load.
- There are two common ways to connect a domain to hosting: change the nameservers to your host's, or keep your registrar's DNS and add an A record pointing to your server's IP address.
- Changing nameservers is easiest for beginners. Using an A record is better when you already have email or other records set up at your registrar.
- You also need to add the domain inside your hosting panel, or the server will not know which folder to show.
- DNS changes often work within a few hours, but registrars such as GoDaddy say to allow up to 48 hours.
You bought a domain from one company and hosting from another. Now you type your domain in the browser and see a parking page or an error. You are not sure what nameservers, A records or DNS mean.
This guide explains how to connect a domain to hosting in plain English, with both methods, a checklist and fixes for the common problems.
How domains and hosting work together
Think of it like this:
- Domain: The name people type, like
yoursite.in. - Hosting: The computer (server) where your website files live. It has an IP address, a number like
203.0.113.10. - DNS: The address book that tells browsers which IP address belongs to your domain.
Connecting a domain to hosting means updating that address book so your domain points to your hosting server. You also tell the hosting server to accept visitors for that domain.
Nameservers vs A record: which method should you use?
| Point | Change nameservers | Add an A record |
|---|---|---|
| What you change | Who manages all DNS for the domain | Only where the website points |
| Where you manage DNS after | In your hosting panel | At your domain registrar |
| Difficulty | Easiest | Easy, one or two records |
| Effect on existing email records | Old records stop working unless you add them again at the host | Other records stay as they are |
| Best for | New domains with nothing else set up | Domains that already use email or other services |
Before you start: what you need
- Login for your domain registrar (where you bought the domain).
- Login for your hosting control panel (cPanel, hPanel or similar).
- Your host's nameservers, usually two or more lines like
ns1.yourhost.com. Find them in your hosting welcome email or account dashboard. - Or, for the A record method, your server's IP address, also shown in the hosting dashboard.
Method 1: Connect a domain by changing nameservers
Step 1: Add the domain in your hosting panel
Most shared hosting plans ask you to add the domain first. In cPanel this is usually under Domains. Other panels have a "Add website" or "Add domain" button. Choose the folder where your site files will go.
Step 2: Copy the host's nameservers
Copy them exactly. One wrong letter will stop the domain from working.
Step 3: Update nameservers at your registrar
- Log in to your registrar and open your domain list.
- Click the domain and look for Nameservers or DNS.
- Choose the option to use custom nameservers. The exact label differs between registrars.
- Delete the old nameservers and paste your host's nameservers.
- Save the changes.
Step 4: Wait and test
GoDaddy's help page on DNS propagation time says changes usually spread within a few hours but can take up to 48 hours. Nameserver changes can take longer than normal record changes, because the domain registry also has to update.
Method 2: Connect a domain using an A record
Step 1: Add the domain in your hosting panel
Same as Method 1. The server must know about your domain.
Step 2: Find your server IP address
Look in your hosting dashboard for "Shared IP", "Server IP" or "Dedicated IP". Copy it.
Step 3: Edit DNS records at your registrar
- Open the DNS management page for your domain.
- Find the A record with the name
@(this means the main domain). Edit it, or add one if none exists. - Paste your server IP address as the value. Leave TTL on the default.
- For
www, add a CNAME record with namewwwpointing to your main domain, or an A record with the same IP. Use whatever your host recommends. - Delete any old A record for
@that points to a parking page. Two different A records for the same name can make the site load randomly. - Save and wait.
Step after connecting: install SSL (HTTPS)
Once the domain points to your hosting, turn on SSL so your site loads with https://. Most hosts offer a free SSL certificate in the panel. SSL usually installs only after DNS points to the server, so do this step last.
Then force HTTPS so all visitors use the secure version. Many panels have a simple switch for this.
How to check if your domain is connected
- Open your domain in a private (incognito) browser window. Old pages are often cached in normal windows.
- Try it on mobile data instead of Wi-Fi. Different networks update at different times.
- Use a public DNS lookup tool to see which IP address your domain shows from different locations.
- Upload a small test file such as
test.htmlto your site folder and openyoursite.in/test.html. If it loads, the connection works. Delete it after.
Domain not connecting? Common problems and fixes
| Problem | Likely cause | Fix |
|---|---|---|
| Registrar parking page still shows | DNS has not updated yet, or old A record still exists | Wait, clear cache, remove the parking A record |
| Hosting default page shows | Domain points correctly but no site files uploaded | Upload your files or install your script in the right folder |
| Works on one phone, not another | DNS still spreading across networks | Wait up to 48 hours |
| "Not secure" warning | SSL not installed or HTTPS not forced | Install free SSL and turn on HTTPS redirect |
| Email stopped working | Nameservers changed and email records were not copied | Add your email provider's MX and TXT records at the new DNS host |
| www works but main domain does not (or the reverse) | Record missing for one of them | Add both the @ and www records |
What to do after your domain is live
- Install your website or script. Our step-by-step guide on installing a PHP script on cPanel hosting shows how.
- Add the site to Google Search Console and submit your sitemap. See how to submit a sitemap.
- Check your site speed on mobile with our Core Web Vitals guide.
If you have not chosen what to build yet, the GeniusGuru marketplace has ready-made website scripts, such as the AI auto news website script and the Sarkari form photo and signature resizer script. Both need a connected domain and hosting, which is exactly what this guide sets up.
Final word
Connecting a domain to hosting has two parts: add the domain in your hosting panel, then point the domain to your host with nameservers or an A record. Be patient with DNS, protect your email records, and turn on SSL at the end.
Next step: log in to your hosting dashboard now, note your nameservers and server IP, and decide which method fits your domain using the table above.
Frequently asked questions
How long does it take for a domain to connect to hosting?
It often works within a few hours, but registrars such as GoDaddy say DNS changes can take up to 48 hours to spread across the internet.
Should I change nameservers or add an A record?
Change nameservers for a new domain with nothing else set up. Use an A record if you already use email or other services on the domain, so those records stay untouched.
Why does my domain still show a parking page?
DNS may not have updated yet, your browser may be showing a cached page, or an old A record still points to the parking server. Remove the old record and test in a private window.
Do I need to add the domain in my hosting panel too?
Yes. Most hosting panels need the domain added so the server knows which folder to show for it.