Overview: Two Ways to Connect a Domain to Hosting
When your domain name is registered with one company and your web hosting is provided by another, you need to link the two together. There are two main methods:
- Update your nameservers at your domain registrar to point to your hosting provider's DNS.
- Update the A record in your current DNS zone to point to your hosting server's IP address.
Method 1 (nameservers) is simpler and recommended for most users. Method 2 (A record) gives you more control and is better if you want to keep using your registrar's DNS for other services (like Cloudflare).
Method 1: Changing Your Nameservers
This hands over DNS management entirely to your hosting provider. Here's how:
Step 1: Find Your Hosting Provider's Nameservers
Log in to your hosting account and look for your assigned nameservers in the account dashboard or welcome email. They typically look like:
ns1.yourhostingprovider.comns2.yourhostingprovider.com
Common hosting providers (cPanel hosts, SiteGround, Bluehost, etc.) all list these clearly in your account area.
Step 2: Update Nameservers at Your Registrar
- Log in to your domain registrar (Namecheap, GoDaddy, etc.).
- Navigate to your domain's management page.
- Find the "Nameservers" section — it may be under DNS Settings or Domain Management.
- Switch from "Default" or "Automatic" nameservers to "Custom" nameservers.
- Enter the nameservers provided by your hosting company.
- Save changes.
Step 3: Wait for Propagation
DNS propagation takes anywhere from a few minutes to 48 hours. During this time, some users may see the old site and others the new one, depending on which DNS servers their ISP uses. You can monitor propagation at whatsmydns.net.
Method 2: Updating the A Record
Use this method if you want to keep your current DNS provider (e.g., Cloudflare) and only redirect web traffic to a new server.
Step 1: Find Your Hosting Server's IP Address
Log in to your hosting control panel. The server IP address is usually displayed on the main dashboard or under "Account Information." It looks like 198.51.100.42.
Step 2: Edit the A Record in Your DNS Zone
- Log in to wherever your DNS zone is managed (your registrar's DNS, Cloudflare, etc.).
- Find the DNS records section for your domain.
- Locate the existing A record for your root domain (
@oryourdomain.com). - Edit the value to your new hosting server's IP address.
- Also update the www A record or CNAME if applicable.
- Save changes.
Setting Up Your Domain in cPanel
If your hosting uses cPanel (common with shared hosting), you may also need to add your domain as an Addon Domain or verify it's set as the primary domain:
- Go to cPanel → Domains → Addon Domains (if it's not your main domain).
- Enter your domain name and assign a document root folder.
- Upload your website files to that folder via File Manager or FTP.
Don't Forget: SSL Certificate
Once your domain is pointing to your hosting, install an SSL certificate to enable HTTPS. Most modern hosts offer Let's Encrypt certificates for free via cPanel (AutoSSL) or a one-click install. HTTPS is essential for security, user trust, and SEO rankings.
Troubleshooting Common Issues
| Problem | Likely Cause | Fix |
|---|---|---|
| Site still shows old host | DNS not propagated yet | Wait up to 48 hrs; clear browser cache |
| "Domain not configured" error | Domain not added in cPanel | Add as Addon Domain in cPanel |
| SSL not working | Certificate not installed | Run AutoSSL or install Let's Encrypt |
| www doesn't resolve | Missing www A or CNAME record | Add www CNAME pointing to root domain |