Guides · 9 min read ·
How to Connect a Domain to Your Hosting: Nameservers vs DNS Records
How to connect a domain to hosting by changing nameservers or adding an A record, how long propagation takes, how to check it and the mistakes to avoid.
To connect a domain to your hosting, you either change the domain's nameservers to your host's nameservers, or keep your current DNS provider and add an A record that points the domain at your hosting server's IP address. For HostEthical hosting, the nameservers are ns1.hostethical.com and ns2.hostethical.com, and the IP for the A-record method is shown in your dashboard. Most changes start working within a few hours, although a full worldwide update can take up to 48 hours.
How a domain finds your website
When someone types your domain into a browser, their device asks a DNS resolver for the server's IP address. That resolver is usually run by their internet provider, such as Jio, Airtel or BSNL, or is a public one like Google's 8.8.8.8. The resolver asks the registry which nameservers are in charge of your domain, asks those nameservers for the address, and the browser then connects to that IP. Two settings control this chain:
- Nameservers are set at your registrar and decide which DNS service is in charge of your domain.
- DNS records live on those nameservers and say where each service goes: A records for the website, MX records for email, TXT records for verification and email security.
Connecting a domain to hosting means changing one of these two things. If DNS terms are new to you, our guide to DNS records explained covers every record type.
Nameservers vs DNS records: which method should you use?
| Change nameservers | Add an A record | |
|---|---|---|
| What you change | The two nameservers at your registrar | One or two records at your current DNS provider |
| Who manages DNS afterwards | Your hosting provider | Your existing DNS provider |
| Effect on existing email | Email records must be recreated on the new DNS, or email stops | None; email records are untouched |
| Time to take effect | Usually a few hours, up to 48 | Often minutes to a few hours, depending on the old TTL |
| Best for | New domains and simple sites; keeping everything in one place | Domains already used for business email or other services |
| If you change hosts later | Change the nameservers again | Edit one record |
A simple rule: if the domain is new, or nothing else depends on it, change the nameservers. If the domain already runs business email through Google Workspace or Microsoft 365, or powers other services, add an A record and leave everything else alone.
Method 1: how to change nameservers
Changing nameservers hands your whole DNS zone to HostEthical. From then on, the records for your domain are managed on our side rather than at your old DNS provider, so anything that existed there has to be recreated.
If your domain is registered with HostEthical
- Log in to your dashboard, open Domains and select the domain.
- Open the Nameservers section.
- Enter
ns1.hostethical.comandns2.hostethical.com, then save.
Every domain registered with us includes a free DNS editor, so you can add MX, TXT or subdomain records in the same dashboard afterwards.
If your domain is registered somewhere else
Every registrar's control panel looks different, but the steps are the same everywhere:
- Log in to the account where you bought the domain. This is the registrar, which is not always the company that hosted your old website.
- Open your domain list and click Manage, DNS or Domain settings next to the domain.
- Find the Nameservers section. It is usually set to "default" or "registrar nameservers". Choose the option for custom nameservers.
- Remove the existing entries and add these two:
ns1.hostethical.com ns2.hostethical.com - Save. Some registrars send a confirmation email or OTP before applying the change; complete it, or nothing happens.
Method 2: how to point a domain with an A record
If you would rather keep DNS where it is, leave the nameservers alone and change only the records for the website:
- Find your hosting IP. It is shown in your HostEthical dashboard on your hosting account's details.
- Log in where your DNS is actually managed. That is wherever your nameservers point. A WHOIS lookup shows the current nameservers if you are unsure.
- Edit the A record for the root domain so it points to the hosting IP. If there is more than one A record for the root, delete the old ones; otherwise visitors will randomly land on the old server.
- Point www as well, either with a CNAME to your root domain or with a second A record to the same IP.
- Delete AAAA records for the root and www that point to your old host.
- Save, then wait for the old TTL to run out.
| Type | Host / Name | Value | TTL |
|---|---|---|---|
| A | @ | Your hosting IP from the dashboard | 3600 or Auto |
| CNAME | www | yourdomain.in | 3600 or Auto |
| AAAA | @ and www | Delete if it points to your old host | — |
The @ symbol means the root domain itself. Some DNS panels want the host field left blank or the full domain typed in instead; their help text will say which.
Tip: if you are planning a move in advance, lower the TTL on the existing A record to 300 seconds a day before. Resolvers then hold on to the old address for five minutes instead of an hour or more, so the switch-over is much faster.
How long does DNS propagation take?
"Propagation" is really caching. Resolvers around the world remember each DNS answer for as long as its TTL allows, so after a change some visitors keep getting the old answer until their resolver's copy expires.
- A record changes usually take effect within the old record's TTL, which is often between five minutes and a few hours.
- Nameserver changes are slower, because registries publish nameserver delegations with long TTLs. For .com domains it is two days, which is where the "up to 48 hours" figure comes from. In practice most visitors see the change within a few hours.
During this window it is normal for the site to load on mobile data but not on your office Wi-Fi, or the other way round. Resist the urge to keep changing settings; every change restarts the clock.
Clear the cache on your own device
Your computer and browser cache DNS answers too. To clear them:
# Windows (Command Prompt)
ipconfig /flushdns
# macOS (Terminal)
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
# Linux with systemd-resolved
resolvectl flush-caches
Chrome keeps a separate cache that you can clear at chrome://net-internals/#dns. Alternatively, test in a private window on mobile data, which uses a different resolver from your home or office connection.
How to check that your domain points to your hosting
With nslookup (Windows, macOS and Linux)
nslookup -type=ns yourdomain.in
nslookup yourdomain.in 8.8.8.8
nslookup yourdomain.in 1.1.1.1
The first command shows which nameservers the domain uses. After Method 1 you should see ns1.hostethical.com and ns2.hostethical.com. The other two ask Google's and Cloudflare's public resolvers for the IP address, which should match the one in your dashboard.
With dig (macOS, Linux, or Windows with WSL)
dig NS yourdomain.in +short
dig A yourdomain.in +short
dig A www.yourdomain.in +short
dig @8.8.8.8 yourdomain.in A +short
dig +trace yourdomain.in
+trace follows the lookup from the root servers down to your nameservers without using any cache, so it shows what the registry is publishing right now, even while other resolvers still hold old answers.
With online checkers
Search for a "DNS propagation checker". These sites query resolvers in many countries at once and show which ones already return your new IP. Use them to confirm progress, not as a deadline: a few red crosses an hour after a change are normal.
Common mistakes when connecting a domain to hosting
- Editing records in the wrong place. Once the nameservers point to a new provider, records at the old DNS provider are ignored. Always check which nameservers are active before editing anything.
- Forgetting email records. This is the most common cause of "my email stopped working after I moved my website". Copy MX and TXT records across before or immediately after a nameserver change.
- Leaving an old A or AAAA record. Two A records for the same name send visitors to two servers at random. A stale AAAA record is sneakier: a large share of mobile users in India connect over IPv6, so they reach your old host while you see the new site on Wi-Fi.
- Pointing only the root or only www. Set up both, so
yourdomain.inandwww.yourdomain.inboth load your site. - Typos in the nameservers.
ns1.hostethical.coor a stray space will fail. Copy and paste them exactly. - An expired, suspended or unverified domain. If the domain has lapsed, or the registrant email was never verified after registration, DNS changes will not help. Our guide to domain expiry and renewal explains the grace periods.
- Expecting HTTPS instantly. A free SSL certificate can only be issued after the domain resolves to the hosting server, so a brief certificate warning straight after a switch is normal. Our guide to SSL certificates explains what happens next.
Do you need to transfer the domain as well?
No. You can host your website with one company and keep your domain registered at another indefinitely; both methods above work across providers. Many people still move the domain later for convenience: one dashboard, one renewal reminder and one support desk.
A transfer needs the EPP or auth code from your current registrar, and our domain transfer page handles the rest. Your nameservers normally stay as they are during a transfer, so the site keeps working. The exception is when the domain uses the old registrar's own DNS service, which may stop answering once the domain leaves, so switch nameservers first in that case. The full process is in our guide on how to transfer a domain.
Frequently asked questions
How long does it take for a domain to connect to hosting?
An A record change usually works within minutes to a few hours, depending on the old TTL. A nameserver change typically takes a few hours and can take up to 48 hours to reach every network.
Will changing nameservers affect my email?
Yes, if your email uses the domain. Changing nameservers replaces all DNS records, so the MX and TXT records for email must be recreated at the new DNS provider or incoming mail will stop.
Can I use my domain with hosting from a different company?
Yes. You can keep the domain at any registrar and point it to hosting elsewhere with nameservers or an A record; transferring the domain is optional.
Why does my website still show the old site after changing DNS?
Your device, browser or internet provider is still using a cached answer. Flush your DNS cache, try mobile data or a private window, and wait for the old TTL to expire.