Skip to content

Connecting a Domain to Hosting: The Complete Guide

The complete guide to connecting a domain to hosting: the difference between changing nameservers and editing the A record, the steps for each method at the registrar, pointing www and the root, propagation time and TTL, checking with dig/nslookup, MX email records, issuing SSL after connecting, and common mistakes and their fixes.

Domainsهند الدوسري30 min read
Illustration of a globe plugged by a cable into a hosting server block, representing connecting a domain to hosting
On this page

What does "connecting a domain to hosting" actually mean?

Many people buy a domain from one company (the registrar) and a hosting plan from another, then are surprised that typing the domain in the browser doesn't open the site, or opens a default page that has nothing to do with them. The reason is that the domain and the hosting are two completely separate things: the domain is just a name you own, and the hosting is a server with an IP address on which your site lives. Unless you explicitly connect the two, the internet doesn't know where to find your site when your name is requested.

Connecting is not a "file transfer" operation; it is configuring DNS records so your domain name is translated into your hosting server's address. When a visitor types example.com, their browser starts a lookup journey through the domain name system until it reaches the record that says: "this name points to server number such-and-such." Your job when connecting is to put this record in place correctly, either by delegating DNS entirely to the host or by editing a single record yourself. If you want to deepen your understanding of the records themselves before continuing, our article DNS records explained covers each type in detail.

How is a domain name resolved to an IP address?BrowserRequests the siteResolverResolverRootRootTLD server.comAuthoritative serverAuthoritativeThe IP address (e.g. 93.184.216.34) returns and the site opens
The lookup journey: browser > resolver > root > TLD server (such as .com) > authoritative server, and then the IP address comes back.

To fix the mental picture, imagine three parties: the registrar (where you bought the domain and where its nameservers are managed), the DNS provider (the party that holds your actual records), and the hosting provider (the server that holds your site's files and has an IP address). In many cases the registrar and the DNS provider are the same company, and sometimes the DNS provider is the hosting provider. Connecting = pointing the arrow from the domain to the hosting server, and the method depends on whom you choose to manage DNS.

ConceptWhat it isExample
RegistrarWhere you buy and renew the domainGoDaddy, Namecheap
Nameservers (NS)The servers that are "asked" about your domain's recordsns1.example.net
DNS providerWho holds your records (A, MX, CNAME…)The registrar's panel, the hosting panel or Cloudflare
HostingThe server that holds your site and has an IPA server at 185.199.108.153
ConnectingPointing the domain to the hosting serverChanging NS or the A record

The two methods: nameservers vs. A record

Now to the core of the article. There are two main ways to connect your domain to hosting, and both are correct, but they differ in "who manages DNS" and in the amount of control and risk. Understanding the difference determines every later step, and even whether your email keeps working or stops.

Two ways to connect a domain to hostingMethod 1 · NameserversDomainAt the registrarChange NSTo the host's nameserversHost manages DNSAll records thereThe host controls all records — simplest for beginnersMethod 2 · A recordDomainNS stays at registrarA record: @ and wwwTo the hosting IPHosting serverStatic IPPoint a single record to the IP — finer control over each record
The two ways to connect a domain to hosting: changing nameservers (the host manages all DNS) or an A record (pointing @ and www to the hosting IP while NS stays at the registrar).

Method 1: changing nameservers (full DNS delegation)

With this method, you go to the registrar's panel and replace the default nameservers with the nameservers your hosting provider gives you (such as ns1.example.net and ns2.example.net). The effect is that you delegate DNS management entirely to the host: from now on, all your records (A for the website, MX for email, TXT, CNAME…) are managed from the hosting panel, not from the registrar.

This method is the simplest and most common for beginners, and for good reason: when you connect via nameservers, the hosting panel (usually cPanel) creates all the necessary records automatically — the A record for the site, www, and usually the email records. You set one thing (the nameservers) and everything is connected at once.

Method 2: A record only (pointing to the IP)

Here you keep the nameservers as they are at the registrar (or at a DNS provider you choose, such as Cloudflare), and you delegate nothing to the hosting. Instead, you go to the DNS editor at your current provider and edit only the A record so it points to the hosting server's IP address. The domain now points to the right server, but the rest of your records (email, for example) stay as they were.

The advantage of this method is separation: you can point the website to one server and keep email on another service (such as Google Workspace) without either one affecting the other. It also lets you use an advanced DNS provider such as Cloudflare for protection and CDN while hosting the site elsewhere.

CriterionChanging nameserversA record
Who manages DNSThe hosting providerYour current provider (registrar/Cloudflare)
Records affectedAll of them (website + email + everything)The A record only
Ease of setupSimplest (a single setting)Requires understanding records
Fine-grained controlLower (everything is at the host)Higher (each service kept separate)
Risk of email stoppingHigh if MX isn't movedLow (email isn't touched)
Using a CDN such as CloudflareRequires extra setupDirect and easy
Best forBeginners, website + email on the same hostAdvanced users, separating services

When should you choose each method?

The practical rule is simple:

  • Choose changing nameservers if you are a beginner, you will host the website and email with the same hosting provider, and you want the simplest "set it once and forget it" path. This is the default choice for most WordPress sites on shared hosting.
  • Choose the A record if your email is hosted elsewhere and you don't want to touch it, if you use Cloudflare to manage DNS and protection, or if you want to point only the website while keeping other records under your control.

A crucial point that is often forgotten: when you change nameservers, you give up all your old records at the registrar, including the MX email records. If you have working email and you haven't moved the MX records to the new hosting panel, your email will stop immediately. We will dedicate a whole section to this warning later.

Where do you find the nameservers or the hosting IP address?

Before you connect anything, you need the right information from the hosting side: either the nameserver names (for the first method) or the server's IP address (for the second method).

For nameservers: you will usually find them in:

  • The welcome email you received when you bought the hosting — most companies state them clearly.
  • The hosting provider's client area, under the service details.
  • The company's help/knowledge base page (search for "nameservers").

For the server's IP address: you will find it in:

  • The welcome email as well (Shared IP or Server IP).
  • cPanel: in the sidebar under "General Information," "Shared IP Address" or "Dedicated IP" is shown.
  • By asking technical support if you can't find it.
What you needMatching methodWhere to find it
ns1.host.com / ns2.host.comChanging nameserversWelcome email / client area
185.199.108.153 (IP)A recordWelcome email / cPanel (Shared IP)

An important warning: make sure you use the correct nameservers for your specific company, not a generic example from an article on the internet. Every company has its own servers. And don't mix them: use either nameservers or an A record, not both for the same destination.

Steps for method 1: changing nameservers

The process is similar at almost every registrar, with a small difference in where the button is. The general steps:

  1. Log in to the registrar's panel (where you bought the domain, not where you bought the hosting — unless they are the same company).
  2. Open your domain list and select the domain you want.
  3. Look for the "Nameservers" or "DNS" section.
  4. Choose "Custom Nameservers" instead of the default ones.
  5. Delete the old values and enter your host's nameservers (usually two, sometimes four).
  6. Save. Now wait for propagation (we will explain it).

An example of the values you will enter:

bash
ns1.example.net
ns2.example.net

Where do you find this setting at the major registrars?

The labels vary slightly. This table summarizes the path at the best-known ones:

RegistrarPath to the nameserver setting
GoDaddyMy Products > Domains > domain name > DNS > Nameservers > Change
NamecheapDomain List > Manage > Nameservers > Custom DNS
Cloudflare (as a registrar)Domain > DNS > managed via Cloudflare's nameservers automatically
Google Domains / SquarespaceMy domains > DNS > Custom name servers
HostingerDomains > Manage > DNS / Nameservers > Change Nameservers
name.comMy Domains > domain name > Nameservers > Edit

After saving, the hosting panel (usually cPanel) creates the A and www records automatically when you add the domain as an "Addon Domain" or when it is the account's primary domain. Check that the domain is actually added in the hosting panel; otherwise the host's default page will appear.

Steps for method 2: editing the A record

With this method, you go to the DNS editor at your current provider (the registrar or Cloudflare) and edit the A record. The steps:

  1. Log in to your DNS provider (the registrar, Cloudflare, or wherever your records are managed).
  2. Open the DNS editor / DNS Management / Advanced DNS.
  3. Look for the A record named @ (it represents the root). If it exists, edit it; otherwise create a new one.
  4. Put the hosting server's IP address in the value field (Value/Points to).
  5. Set the TTL to a low value (such as 300 seconds) during the change to speed up propagation.
  6. Repeat for www (an A record with the same IP, or a CNAME pointing to the root — details shortly).
  7. Save and wait for propagation.

Examples of the record values you will enter:

bash
# Point the root with an A record
Type: A     Name: @      Value: 185.199.108.153     TTL: 300

# Point www with an A record too
Type: A     Name: www    Value: 185.199.108.153     TTL: 300

# Or point www as a CNAME that follows the root (a neat alternative)
Type: CNAME Name: www    Value: example.com.        TTL: 300

Note: with the second method you don't touch the MX records at all, so your email keeps working as it is — this is its biggest advantage.

Pointing the root (@) and www: A or CNAME?

One of the most confusing points. Your domain has two forms that must both work: the root example.com (written in the DNS panel with the @ symbol), and the www version, i.e. www.example.com. The goal is for both to open the same site.

NameRepresentsSuitable recordWhy
@The root example.comA (to an IP)A CNAME isn't allowed on the root
wwwwww.example.comA or CNAMEBoth work

The decisive rule: you can't put a CNAME on the root (@) because of a technical constraint in the DNS protocol (the root must carry SOA and NS records, and DNS rules forbid mixing a CNAME with them). So the root is always an A record pointing to an IP. www, on the other hand, is an ordinary subdomain, so you choose:

  • An A record for www with the same IP as the root (the simplest and clearest).
  • Or a CNAME for www pointing to the root example.com. — its advantage is that if you change the root's IP later, www follows it automatically without a second edit.

What if your host gives you a name instead of an IP address for the root (as with some cloud deployment services)? Here an A record doesn't work and a CNAME isn't allowed on the root, so you use an ALIAS/ANAME record if your provider supports it (a flattened CNAME). We covered this in detail in DNS records explained.

A practical tip: don't settle for just one of them. Set up both the root and www, then decide which one is the "official" (canonical) version and redirect the other to it with a 301 redirect from the site settings, so two duplicate addresses don't get indexed.

Record types you may need

When connecting, you will usually deal with these records. Understanding the role of each one spares you common mistakes:

RecordTypical nameWhat it doesExample value
A@Points the root to an IPv4 address185.199.108.153
AwwwPoints www to an IPv4 address185.199.108.153
CNAMEwwwMakes www follow the rootexample.com.
CNAMEblog / shopA subdomain that follows an external namestore.shopify.com.
MX@Routes email to the mail servermail.example.com (priority 10)
TXT@Email verification and security (SPF)"v=spf1 include:... ~all"
AAAA@Points the root to an IPv6 address2606:2800:220:1::

Note that the AAAA record is optional but useful if your server supports IPv6; it coexists with A without any problem. MX and SPF, on the other hand, are the heart of email, and we will come back to them in the email warning section.

TTL and propagation time: why doesn't the site open immediately?

After saving the change, don't expect the site to open instantly for everyone. The reason is DNS propagation: the change is recorded on your authoritative server immediately, but thousands of resolvers around the world still hold the old version in their cache until the TTL they stored it with expires.

The TTL (Time To Live) is a value in seconds that determines how long resolvers keep a copy of the record before asking for a new one. The lower the TTL, the faster a change propagates (but with more queries).

TTL valueDurationWhen to use it
3005 minutesBefore any planned change (fast propagation)
36001 hourThe normal setting for stable records
144004 hoursRecords that rarely change
86400A full dayVery stable records (NS, for example)

The actual propagation time varies by the type of change:

Type of changeTypical propagation timeMaximum
Editing an A record (low TTL)Minutes to an hourA few hours
Editing an A record (high TTL)As long as the old TTLUp to 24 hours
Changing nameserversHoursUp to 24–48 hours

How do you speed up propagation?

The golden trick: lower the TTL at least a day before the change. If the current TTL is 86400 (a day), lower it to 300 and wait a full day for this reduction itself to propagate. Then, when you make the actual change, it will propagate within 5 minutes because resolvers no longer cache the record for long. Once the site is stable, set the TTL back to a higher value.

Remember that changing nameservers takes longer than editing an A record, because it goes through the TLD layer (the NS records at the registrar), which has a high TTL you don't control. Be patient here — it can take 24–48 hours in the worst cases.

Verifying: dig, nslookup and propagation tools

Don't judge whether the connection succeeded by "does the site open for me?", because your device may be serving a locally cached copy. Use tools that query the servers directly.

Command/toolPlatformChecks
digLinux/macOSAny record in full detail, with TTL
nslookupWindows/allA quick lookup of a specific record
pingAllWhether the address responds (confirming the IP)
Online checkerBrowserPropagation across global locations

Practical examples for checking the A record and nameservers:

bash
# Confirm the IP address the root points to
dig example.com A +short

# Confirm www
dig www.example.com +short

# Show the domain's current nameservers
dig example.com NS +short

# Query a public resolver to bypass your device's local cache
dig @1.1.1.1 example.com A +short

# The same idea on Windows
nslookup example.com
nslookup -type=NS example.com
nslookup example.com 1.1.1.1

To confirm that the address responds after pointing the A record, you can use ping (but note: some servers disable ping replies for security reasons, so no response doesn't necessarily mean an error):

bash
# Does the address respond? It shows the IP the name resolves to
ping example.com

To check propagation globally, use an online checker such as "whatsmydns" that queries dozens of locations around the world at once. If the new value appears in some locations and the old one in others, propagation is in progress and not yet complete — wait as long as the old TTL. And to bypass your device's cache, query a public resolver directly, as in the example above with @1.1.1.1.

A tip: if the site doesn't open only for you while it shows up fine in the online checker, the problem is your device's cache. Flush your local DNS cache: on Windows ipconfig /flushdns, and on macOS sudo dscacheutil -flushcache.

A critical warning: MX email records when changing nameservers

This is the mistake that most often costs people their email. When you change nameservers (the first method), you move the management of all your records to the new hosting panel. The hosting panel knows nothing about the old MX records that were at the registrar or at your email provider. The result: incoming email stops immediately unless you recreate the correct MX records in the new panel.

The common dangerous scenario: you have email on Google Workspace or Microsoft 365, and your site is on separate hosting. You change the nameservers to connect the site, lose your email provider's MX records, and email stops without warning.

SituationRiskFix
Changing NS with your email on the same hostLow (the host creates MX automatically)Just confirm MX exists in the panel
Changing NS with your email on Google/MicrosoftVery high (immediate outage)Re-enter your email provider's MX records manually
Editing the A record onlyNo riskEmail isn't touched at all

An example of MX records you need to re-enter if your email is with an external provider:

bash
# Typical MX records (actual values come from your email provider)
Type: MX   Name: @   Priority: 1    Value: aspmx.l.google.com.
Type: MX   Name: @   Priority: 5    Value: alt1.aspmx.l.google.com.
Type: MX   Name: @   Priority: 10   Value: alt2.aspmx.l.google.com.

# And don't forget SPF inside TXT
Type: TXT  Name: @   Value: "v=spf1 include:_spf.google.com ~all"

The warning in short: before changing nameservers, take a screenshot of or copy all your current records (especially MX and TXT) from the old DNS panel, then re-enter them in the new panel right after switching. And if your only concern is connecting the website while your email lives elsewhere, seriously consider the second method (A record), which doesn't touch email at all.

Issuing SSL after the connection succeeds

An SSL certificate (which enables HTTPS and the green padlock) can only be issued successfully after your domain actually points to the server. The reason is that most free certificates (Let's Encrypt) verify your ownership of the domain by requesting a file from the server the name points to (HTTP-01 validation). If the connection isn't complete and propagated, validation fails and errors appear.

The correct order:

  1. Connect the domain (NS or A) and wait for propagation to complete.
  2. Make sure http://example.com and http://www.example.com open your site (not the host's default page).
  3. Issue the certificate from the hosting panel (AutoSSL in cPanel usually does this automatically within hours, or do it manually via Let's Encrypt).
  4. Enable the redirect from HTTP to HTTPS.

If you see a "certificate doesn't match the domain" or "NET::ERR_CERT_COMMON_NAME_INVALID" error, the cause is usually that the certificate was issued before the connection was complete, or that you are issuing a certificate for example.com without including www (or vice versa). Reissue it after confirming that both names point to the server. For full details, see our dedicated guide. And remember that a CAA record (if one exists) can block a particular certificate authority; make sure it allows your certificate's issuer.

Subdomains

Connecting a subdomain such as blog.example.com or app.example.com follows the same logic, but it is simpler: a subdomain is just an extra DNS record under your domain and doesn't need a separate purchase. You create it by adding:

  • An A record for the subdomain if you know its server's IP address.
  • A CNAME record if it follows an external name (a cloud service, a third-party store).
bash
# A subdomain on your own server (you know the IP)
Type: A      Name: blog    Value: 185.199.108.153    TTL: 3600

# A subdomain that follows an external service by name
Type: CNAME  Name: shop    Value: mystore.myshopify.com.   TTL: 3600

Note that a subdomain may need its own SSL certificate (or a wildcard certificate covering *.example.com). If you use the first method (nameservers), you add these records in the hosting panel; if you use the A record method, you add them at your current DNS provider.

A vs. CNAME for www in one line

A recurring question that deserves a decisive summary:

Option for wwwWhen to choose itDrawback
A (same IP as the root)You want complete clarityIf you change the root's IP, you edit two records
CNAME (follows the root)You want www to follow the root automaticallyDoesn't work on the root itself, only on www

Both are functionally correct. Most professionals prefer a CNAME for www (following the root) to reduce future editing points, with an A record on the root always.

Troubleshooting

Most problems after connecting have known causes. This table maps symptom to cause to fix directly:

SymptomLikely causeFix
The site doesn't open at allPropagation isn't completeWait as long as the old TTL; check with dig @1.1.1.1
It opens for you but not for othersAn old local cache on your deviceFlush the DNS cache (ipconfig /flushdns)
The old site appearsResolvers are still holding the old IPWait for propagation; check the new A value
The host's default pageThe domain isn't added in the hosting panelAdd it as Addon/Primary in cPanel
SSL error / broken padlockThe certificate was issued before the connection was completeReissue SSL after propagation, including www
Email suddenly stoppedMX records were lost after changing NSRe-enter MX (and SPF) in the new panel
www doesn't work but the root doesThe www record is missingAdd an A or CNAME record for www
The root doesn't work but www doesThe A record on the root (@) is missing/wrongAdd/correct the A record on @
The change never propagatesIt wasn't actually saved, or a duplicate domainSave again; delete conflicting records

A quick command-line diagnosis when "the site won't open":

bash
# 1) Which IP does the name point to now?
dig example.com A +short

# 2) Compare with the IP your host gave you. Different? The change hasn't propagated yet.

# 3) What are the current nameservers? Are they really your host's servers?
dig example.com NS +short

# 4) Bypass your device's cache to confirm the actual value on the internet
dig @8.8.8.8 example.com A +short

Common mistakes and expert tips

Mistakes many people make when connecting — avoid them in advance:

  • Mixing the two methods: setting the nameservers to the host, then editing the A record at the registrar — the latter is ignored because DNS is now managed at the host. Choose one method.
  • Forgetting the MX records after changing nameservers, so email stops. Copy them before switching.
  • Pointing only the root and forgetting www (or vice versa), so half your visitors complain the site won't open.
  • Trying to put a CNAME on the root (@) — technically forbidden; use A or ALIAS.
  • Judging propagation from your own device, loaded with an old cache, instead of an online checker or @1.1.1.1.
  • Issuing SSL before the connection is complete, so validation fails and certificate errors appear.
  • Leaving the TTL high before a planned move, so propagation is delayed by hours for no reason.
  • Using the wrong IP or nameservers from a generic example rather than from your own company.

Expert tips that save you time:

  • Lower the TTL a day before the move to 300 seconds, then make the change, then set it back to a higher value.
  • Copy the entire old DNS zone (a screenshot + a file) before any major change; it is your safety net.
  • Keep the old site running during propagation if you are moving from one server to another, so nobody sees a broken site. Learn how to migrate without downtime in the dedicated migration guide.
  • Test from a different network (mobile data, for example) to bypass your home network's cache and confirm that propagation has actually arrived.
  • If your email is critical, prefer the A record over changing nameservers to isolate the website from email completely.

Choosing a good hosting provider makes all of this easier (a clear panel, documented nameservers, AutoSSL, fast support). If you haven't settled on one yet, see the criteria for choosing a reliable hosting provider. And if you are still at the stage of choosing the name itself, our guide to choosing a strong domain name spares you costly changes later.

Switching the A record when moving a siteDomainA recordOld serverOld IP — retiredNew serverNew IP — activeLower TTLA day before the switchLowering TTL speeds up the switch and shrinks the downtime window
Moving with minimal downtime: lower the TTL in advance, test the new server, then switch the A record from the old IP to the new one.

A practical step-by-step summary

To fix everything above into a single actionable path:

  1. Decide on the method: nameservers (website + email on the same host, the simplest) or an A record (separate services, email elsewhere).
  2. Gather the information: the nameservers or the IP address from the welcome email/hosting panel.
  3. Lower the TTL a day before the change (for the second method in particular).
  4. Make the change: change the nameservers at the registrar, or edit the A record for @ and www at the DNS provider.
  5. Preserve the MX records if you change nameservers and your email is external.
  6. Wait for propagation and verify with dig/nslookup and an online checker.
  7. Issue SSL after the connection is complete, and redirect HTTP to HTTPS.
  8. Set the TTL back to a higher value once things are stable.

Frequently asked questions

What is the difference between changing nameservers and editing the A record to connect a domain? Changing nameservers delegates DNS management entirely to the hosting provider, so all your records (website and email) are managed from its panel — the simplest option for beginners. Editing the A record points only the website to the server's IP address, while the other records (especially email) stay as they are with your current provider. Choose the first for a website and email on the same host, and the second to keep services separate.

How long does it take for a domain connected to hosting to start working? An A record change with a low TTL propagates within minutes to an hour. A nameserver change is slower and can take up to 24–48 hours, because it goes through the TLD layer, which has a high TTL. To speed things up, lower the TTL to 300 seconds a day before the change, and check propagation with dig or an online checker instead of relying on your own device.

Why do I see the old site or the host's default page after connecting? If the old site appears, resolvers are still holding the old IP — wait for propagation and flush your local DNS cache. If the host's default page appears, the domain is most likely not added inside the hosting control panel (cPanel), even though the connection is correct; add it as the primary domain or an addon domain and its records will be created automatically.

Will my email stop when I connect the domain to hosting? Only if you change nameservers while your email is hosted elsewhere (such as Google Workspace) and you don't re-enter the MX records in the new panel. To avoid this, copy the MX records before switching and re-enter them immediately, or use the A record method, which doesn't touch email at all.

Which IP address do I put in the A record? Your hosting server's IP address. You will find it in the welcome email you received at purchase, in cPanel under "General Information" as "Shared IP Address," or by asking technical support. Don't use an address from a generic example on the internet; every server has its own address.

Do I need to point www separately from the root? Yes. The root (example.com) and www.example.com are two separate names in DNS. Set an A record on the root (@), and set www with an A record using the same IP or a CNAME pointing to the root. If you forget one of them, half your visitors will reach the site and the rest won't.

Why can't I put a CNAME on the root of the domain? Because the root must carry SOA and NS records, and DNS rules forbid mixing a CNAME with any other record for the same name. So the root is always an A record pointing to an IP. If your host gives you a name rather than an address, use an ALIAS/ANAME record (a flattened CNAME) if your provider supports it.

How do I check that the domain is actually connected to the hosting? Use dig example.com A +short (or nslookup on Windows) and compare the address shown with your server's address. Check the nameservers with dig example.com NS +short. To bypass your device's cache, query a public resolver with dig @1.1.1.1 example.com. And to check propagation globally, use an online checker with multiple locations.

When should I issue an SSL certificate relative to connecting the domain? After the connection is complete and has propagated, and you have confirmed the site opens over http://. Free certificates verify your ownership with a request to the server the name points to, so issuing one before the connection is complete fails. Issue it (or let AutoSSL issue it) after propagation, and make sure it covers both the root and www.

Do I need to set up records for subdomains separately? Yes, but it is simple. A subdomain such as blog.example.com is just an extra record: add an A record if you know its server's IP, or a CNAME if it follows an external service by name. Add it in the hosting panel (if you use nameservers) or at your DNS provider (if you use an A record), and it may need its own SSL certificate or a wildcard certificate.

Can I use Cloudflare to manage DNS with hosting somewhere else? Yes, and this is one of the main uses of the A record method. You change the domain's nameservers to Cloudflare's (once), then manage the A, MX and other records from the Cloudflare panel, pointing them to your hosting server, while benefiting from its protection and network. This way you separate DNS and protection from where the site is hosted.

Sources

Frequently asked questions

What is the difference between changing nameservers and editing the A record to connect a domain?

Changing nameservers delegates DNS management entirely to the hosting provider, so all your records (website and email) are managed from its panel — the simplest option for beginners. Editing the A record points only the website to the server's IP address, while the other records (especially email) stay as they are with your current provider. Choose the first for a website and email on the same host, and the second to keep services separate.

How long does it take for a domain connected to hosting to start working?

An A record change with a low TTL propagates within minutes to an hour. A nameserver change is slower and can take up to 24–48 hours, because it goes through the TLD layer, which has a high TTL. To speed things up, lower the TTL to 300 seconds a day before the change, and check propagation with dig or an online checker instead of relying on your own device.

Why do I see the old site or the host's default page after connecting?

If the old site appears, resolvers are still holding the old IP — wait for propagation and flush your local DNS cache. If the host's default page appears, the domain is most likely not added inside the hosting control panel (cPanel), even though the connection is correct; add it as the primary domain or an addon domain and its records will be created automatically.

Will my email stop when I connect the domain to hosting?

Only if you change nameservers while your email is hosted elsewhere (such as Google Workspace) and you don't re-enter the MX records in the new panel. To avoid this, copy the MX records before switching and re-enter them immediately, or use the A record method, which doesn't touch email at all.

Which IP address do I put in the A record?

Your hosting server's IP address. You will find it in the welcome email you received at purchase, in cPanel under "General Information" as "Shared IP Address," or by asking technical support. Don't use an address from a generic example on the internet; every server has its own address.

Do I need to point www separately from the root?

Yes. The root (example.com) and www.example.com are two separate names in DNS. Set an A record on the root (@), and set www with an A record using the same IP or a CNAME pointing to the root. If you forget one of them, half your visitors will reach the site and the rest won't.

Why can't I put a CNAME on the root of the domain?

Because the root must carry SOA and NS records, and DNS rules forbid mixing a CNAME with any other record for the same name. So the root is always an A record pointing to an IP. If your host gives you a name rather than an address, use an ALIAS/ANAME record (a flattened CNAME) if your provider supports it.

How do I check that the domain is actually connected to the hosting?

Use dig example.com A +short (or nslookup on Windows) and compare the address shown with your server's address. Check the nameservers with dig example.com NS +short. To bypass your device's cache, query a public resolver with dig @1.1.1.1 example.com. And to check propagation globally, use an online checker with multiple locations.

When should I issue an SSL certificate relative to connecting the domain?

After the connection is complete and has propagated, and you have confirmed the site opens over http://. Free certificates verify your ownership with a request to the server the name points to, so issuing one before the connection is complete fails. Issue it (or let AutoSSL issue it) after propagation, and make sure it covers both the root and www.

Do I need to set up records for subdomains separately?

Yes, but it is simple. A subdomain such as blog.example.com is just an extra record: add an A record if you know its server's IP, or a CNAME if it follows an external service by name. Add it in the hosting panel (if you use nameservers) or at your DNS provider (if you use an A record), and it may need its own SSL certificate or a wildcard certificate.

Can I use Cloudflare to manage DNS with hosting somewhere else?

Yes, and this is one of the main uses of the A record method. You change the domain's nameservers to Cloudflare's (once), then manage the A, MX and other records from the Cloudflare panel, pointing them to your hosting server, while benefiting from its protection and network. This way you separate DNS and protection from where the site is hosted.