EN · $ USD
Domains, DNS and SSL

How to Connect a Domain to Web Hosting: Changing Nameservers

7 min read Updated: Sunucu Atlas technical team

In short

There are two ways to connect a domain to hosting: change the nameservers at your registrar to the ones your hosting provider gives you, or leave DNS where it is and point only the A record to the hosting server's IP address. Changing nameservers lets you manage web, email and SSL from one place and is the recommended method for most users. The change can take from a few hours up to 48 hours to propagate.

In this guide
  1. Key Concepts First: Registrar, Nameserver and DNS
  2. Comparing the Methods: Nameservers or A Record?
  3. Method 1: Connecting by Changing Nameservers
  4. Method 2: Pointing Only the A Record
  5. Connecting a Live Site Without Downtime
  6. Checking the Change
  7. What to Do After Connecting
  8. Common Problems
  9. Next Step: Connect Your Domain to Ready-to-Use Hosting

A domain connects to hosting in one of two ways: changing the nameservers to hand DNS management over to the hosting provider entirely, or leaving DNS where it is and pointing only the A record to the hosting server's IP address. If your domain and hosting are with different companies, changing nameservers is the smoothest path for most users. In this guide we compare the two methods, walk through the steps in your registrar's dashboard and show how to check that the change was made correctly.

Key Concepts First: Registrar, Nameserver and DNS

  • Registrar: The company you bought and renew the domain from. This is where you set which nameservers the domain uses.
  • Nameserver: The servers that authoritatively answer DNS queries for your domain. Usually at least two addresses starting with ns1 and ns2.
  • DNS records: Records like A, CNAME, MX and TXT that say which server hosts your site and email. For details, see our DNS records guide.

In short: the registrar points to the nameservers, the nameservers hold the records, and the records point to your server. Connecting hosting means pointing one link in this chain to your new server.

Comparing the Methods: Nameservers or A Record?

CriterionChanging nameserversPointing only the A record
Where is DNS managed?At the hosting provider (cPanel Zone Editor)At your current DNS provider
Email recordsMX, SPF and DKIM are created automatically by the hostYou have to add MX and TXT records by hand
Free SSLDomain validation usually works without issuesWorks if the A record is correct; can fail if a proxy is on
Ease of setupJust enter two addresses and saveEach record has to be added one by one
Best forMost personal and business sitesThose who want to keep DNS on an external service or whose email is elsewhere

General recommendation: if your website and email will be on the same hosting, choose the nameserver method. If you use an external email service like Google Workspace or keep DNS on a CDN/DNS service, changing only the A record (and a CNAME for www if needed) moves the site without disturbing your current setup.

If your domain and hosting are with the same company

If you bought the domain and hosting from the same company in the same order, the nameservers are usually set to the hosting server automatically and you don't need to do anything. Still, if your site doesn't load after a few hours, use the check commands below to confirm the nameservers point to the right addresses. If you previously used the domain with another service, an old nameserver setting may remain; in that case you still need to follow the steps below.

Method 1: Connecting by Changing Nameservers

Preparation on the hosting side

  1. Order your hosting plan with your domain. The service details email you receive when the plan is activated includes the nameserver addresses and the server IP; you can also find them in the service details in your client area.
  2. The domain must be set as the primary domain on the hosting account. If you're adding a second site, first add it as an Addon Domain in cPanel.

Steps in the registrar dashboard

Menu names vary by company, but the flow is almost always the same:

  1. Log in to the client dashboard of the company where you registered the domain.
  2. Select the domain from the My Domains or Domain Management list.
  3. Open the section named Nameservers, Name Servers, DNS Servers or NS Management.
  4. If "default nameservers" or "use registrar DNS" is selected, switch to the custom nameservers option.
  5. Delete the current addresses and enter the ones your hosting provider gave you. Enter at least two addresses; don't add a trailing dot or space.
  6. Save. If the dashboard asks for email confirmation or SMS verification, complete it.

.tr domains (.com.tr, .tr, etc.) are now managed by accredited registrars through TRABİS, Türkiye's .tr domain registry system, so you change their nameservers the same way, from your registrar's dashboard.

Important: If email is already working on your domain, write down the existing MX and TXT records before changing nameservers. If these records are missing from the new DNS zone, your email flow will stop.

Method 2: Pointing Only the A Record

If you want to keep your DNS where it is:

  1. Get the server IP address from your hosting service details.
  2. Open the dashboard where your DNS is managed (this may be your registrar's dashboard or the DNS service you use).
  3. Edit the existing A record for the root domain (@) and set its value to the hosting IP. If there are multiple A records for the same name, delete the old ones.
  4. For www, add a CNAME record pointing to the root domain or an A record to the same IP.
  5. If you'll also use email on the new hosting, match the MX record and the SPF/DKIM TXT records to the values on the hosting side.

If you keep DNS on a CDN or proxy service, temporarily turning off the proxy while the free SSL certificate is issued for the first time makes validation easier.

Connecting a Live Site Without Downtime

If a site is currently live on your domain, a few preparations before you switch keep downtime close to zero:

  1. Move the site to the new hosting first. Upload the files and database to the new account; let the new server sit ready while DNS still points to the old one.
  2. Test the new server before DNS. By adding a temporary line to the hosts file on your computer, you can load the site from the new server on your own device only. On Windows the file is at C:\Windows\System32\drivers\etc\hosts, and on Linux and macOS at /etc/hosts:
    203.0.113.10  firmaniz.com www.firmaniz.com
    Remember to delete this line when testing is done; use your own server IP instead of the one in the example.
  3. If you're using the A record method, lower the TTL in advance. Dropping the TTL to something like 300 seconds a day or two before the change makes the switch propagate within minutes.
  4. Don't cancel your old hosting right away. During propagation, some visitors and emails may still reach the old server; keep the old account open for at least a few days.

Checking the Change

A nameserver change usually shows up within a few hours, but full worldwide propagation can take 24 to 48 hours. During this time, some visitors may see the old server and some the new one. We cover propagation and caching in detail in our article on how long DNS propagation takes.

Use these commands to check:

# Windows: Query the nameservers and the A record
nslookup -type=NS firmaniz.com
nslookup firmaniz.com 8.8.8.8

# Windows: Flush the local DNS cache
ipconfig /flushdns

# Linux / macOS
dig NS firmaniz.com +short
dig A firmaniz.com +short @1.1.1.1

If the NS query returns your hosting provider's addresses and the A query returns the hosting IP, the connection is done. If the commands return the expected result but your browser still shows the old site, clear your browser cache or try a private window.

What to Do After Connecting

  1. Verify SSL: Once DNS points to the new server, a free SSL certificate is issued automatically. If it's delayed, run AutoSSL manually from the SSL/TLS Status screen in cPanel; details are in our article on installing a free SSL certificate.
  2. Upload your site: For WordPress, you can do a one-click install with WP Toolkit or migrate your existing site.
  3. Test email: Create a new mailbox and send and receive email from an outside address.
  4. Turn on the HTTPS redirect: Once the certificate is active, redirect all traffic to HTTPS.

Common Problems

  • "Invalid nameserver" error: You may have mistyped the address, or it isn't yet a registered host. Copy and paste the address from your service email.
  • Domain is locked: On some dashboards a transfer lock doesn't affect nameserver changes, but expired or suspended domains can't be changed. Renew first.
  • The site loads but email doesn't arrive: The MX record still points to the old server or is missing from the new zone.
  • The default cPanel page shows: DNS is correct, but no files have been uploaded to the public_html folder yet.
  • Only www works, or only www doesn't: A record is missing for one of the two names. Check the A record for the root domain and the CNAME or A record for www separately; both must point to the same server.

Next Step: Connect Your Domain to Ready-to-Use Hosting

Sunucu Atlas web hosting plans come with NVMe storage, the LiteSpeed web server and a free SSL certificate; as soon as you point your nameservers, your DNS zone becomes manageable from cPanel. If you're building your site on WordPress, check out the WordPress hosting plans with one-click install through WP Toolkit; SA-WP-1 suits a single site, and higher plans with addon domain limits suit multiple sites. If you get stuck while connecting, open a support ticket for help in Turkish.

Frequently asked questions

How long does a nameserver change take to go live?

It usually shows up within a few hours, but updating caches worldwide can take 24-48 hours. During this time some visitors may see the old server.

I bought my domain from one company. Can I get hosting from another?

Yes. You don't need to transfer the domain; just change the nameservers to your hosting provider's addresses in your registrar's dashboard, or point the A record to the hosting IP.

Will changing nameservers affect my email?

It can. The MX record in the new DNS zone points to the new hosting; if your email will stay on another service, you need to add the old MX and TXT records to the new zone.

Which is better: nameservers or an A record?

If your website and email will be on the same hosting, changing nameservers carries less risk of mistakes. If you keep DNS on an external service or your email is elsewhere, changing only the A record is the better fit.

Where do I find my nameserver addresses?

They're in the welcome email sent when your hosting service is activated and in the service details in your client area. Copying and pasting them is recommended over typing them by hand.

For this guide

Recommended plans

Sunucu Atlas web and WordPress hosting plans let you manage DNS from cPanel the moment you point your nameservers, and get your site live right away with free SSL.

SA-CP-1

cPanel
Recommended

20 GB NVMe disk

$0.39/mo

+VAT

  • Memory1 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 50 GB Traffic
  • 5 Email Account Limit
  • 2 Databases

SA-CP-2

cPanel

40 GB NVMe disk

$0.69/mo

+VAT

  • Processor2 cores
  • Memory2 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 100 GB Traffic
  • 10 Email Account Limit
  • 5 Databases

SA-CP-3

cPanel

60 GB NVMe disk

$0.98/mo

+VAT

  • Processor3 cores
  • Memory3 GB
  • LocationIstanbul
  • 1 Hosted Domains
  • 200 GB Traffic
  • 25 Email Account Limit
  • 10 Databases

Web Hosting — all plans WordPress Hosting — tüm paketler

Need help with setup?

Send questions about your service in a support ticket, and our technical team will walk you through it step by step.