How to Connect a Domain to Your Website: DNS Setup Guide
domainsDNSwebsite launchnameserversSSLemail setuptroubleshooting

How to Connect a Domain to Your Website: DNS Setup Guide

CCloud Site Studio Editorial Team
2026-11-05
7 min read

Learn how to connect a domain to a website, choose nameservers or DNS records, protect email, activate SSL, and troubleshoot common errors.

Connecting a domain to a website involves more than entering a web address into a hosting dashboard. This practical DNS setup guide explains which settings to change, how to protect existing email, how to confirm the connection, and what to check before declaring a launch complete.

Overview

Your domain and your website are usually managed in separate places. The domain is registered with a registrar, while the website may run on a website builder, managed hosting account, cloud web hosting platform, or another server provider. DNS connects the two by telling browsers where to find the site.

There are two common ways to make that connection:

  • Change nameservers: You delegate DNS management to your hosting provider. The provider then supplies or manages the complete DNS zone.
  • Edit DNS records: You keep DNS management at the registrar or current DNS provider and add records such as an A record or CNAME record supplied by the host.

Neither approach is automatically better. Nameserver changes can be convenient for a new website when the host manages all required records. Direct record changes are often safer when the domain already supports email, verification records, subdomains, or other services that must remain under your control.

Before making changes, write down the current DNS records or export the zone if your provider supports it. Pay particular attention to MX records for email, TXT records used for verification or sender authentication, and any subdomains used by applications or developer tools.

Checklist by scenario

Scenario 1: A new domain and a new website

  1. Confirm the exact domain you want to use, including whether the preferred public version is the root domain, such as example.com, or the www version.
  2. Open the hosting or website builder dashboard and locate its domain connection instructions.
  3. Choose nameserver delegation if the host is intended to manage the entire DNS zone and you do not need to preserve existing services.
  4. Choose direct DNS records if you want to keep DNS at the registrar or another DNS provider.
  5. Add the supplied A, AAAA, or CNAME records exactly as specified. Do not add an extra protocol such as https:// to a hostname field.
  6. Set the preferred domain and redirect the alternate version. For example, the host may redirect www.example.com to example.com, or the reverse.
  7. Activate SSL in the hosting dashboard after DNS begins resolving.
  8. Test the website with both HTTP and HTTPS, and with both the root and www versions if they are configured.

Scenario 2: An existing domain with an existing website

  1. Record the current A, AAAA, CNAME, MX, TXT, and relevant subdomain records.
  2. Confirm whether the new host requires a temporary address, preview URL, or verification record before the final switch.
  3. Reduce the risk of downtime by preparing the new website before changing the live DNS records.
  4. Change only the records required for the website. Leave email and unrelated services unchanged unless the migration plan specifically includes them.
  5. Keep the old hosting account available until the new site, forms, redirects, analytics, and important pages have been tested.
  6. Check both the old and new site during the DNS transition. Different networks may resolve the domain differently for a period of time.

If you are moving an entire site, the DNS change is only one part of the process. Review the complete website launch checklist for related checks covering SSL, backups, SEO, and performance.

Scenario 3: You need to preserve business email

  1. Identify which provider handles email and locate the current MX records.
  2. Copy all existing MX records before changing nameservers or replacing a DNS zone.
  3. Preserve the provider's TXT records, including any SPF, DKIM, domain-verification, or DMARC records in use.
  4. After the website connection, send a test message to and from more than one mailbox.
  5. Check that mail delivery, forwarding, aliases, and calendar-related services still work if they depend on the domain.

A website change does not require moving email. If a host asks you to replace nameservers, confirm that the new DNS zone includes every required mail record before approving the change.

Scenario 4: You are connecting a subdomain

  1. Choose a clear hostname, such as shop.example.com, app.example.com, or docs.example.com.
  2. Use a CNAME when the destination is another hostname supplied by a platform.
  3. Use an A or AAAA record when the provider gives you an IP address and specifically instructs you to use it.
  4. Confirm whether SSL must be enabled separately for the subdomain.
  5. Test links between the main site and the subdomain, including any authentication or embedded content.

What to double-check

Record type and host value

An A record points a hostname to an IPv4 address. An AAAA record points it to an IPv6 address. A CNAME points one hostname to another hostname. Use the type your hosting provider specifies rather than substituting one because it appears familiar.

DNS dashboards label the host field differently. Some expect @ for the root domain, while others expect the domain name or leave the field blank. Follow the registrar's format. A CNAME for www should generally use www as the host, not the full URL.

Duplicate and conflicting records

Look for old A records, competing CNAME records, or multiple records pointing the same hostname to unrelated services. A hostname generally should not have a CNAME alongside other record types at the same name. Remove obsolete entries only after confirming they are no longer needed.

Nameserver delegation

If you change nameservers, the old DNS zone is no longer authoritative once the delegation updates. Recreate essential records in the new zone first, especially MX and TXT records. A nameserver change can affect the entire domain, not just the website.

SSL and canonical URLs

DNS only directs traffic; it does not itself provide HTTPS. Confirm that the hosting platform has issued or enabled an SSL certificate for every public hostname you intend to use. Then choose one canonical version and redirect alternate versions consistently.

Propagation and verification

DNS changes are cached by resolvers. The time required for different networks to show the new answer depends on caching and the records' time-to-live settings, so avoid treating one successful or unsuccessful test as definitive. Check from more than one network or DNS lookup tool, and use the hosting provider's verification screen as an additional signal.

For related domain, DNS, and email preparation, see the domain, DNS, and email setup guide.

Common mistakes

  • Editing DNS in the wrong account: The active nameservers determine which provider is authoritative. A record added at an inactive provider will have no effect.
  • Replacing the whole zone unnecessarily: Changing nameservers can remove mail, verification, and subdomain records if they are not copied first.
  • Using a URL in a DNS field: DNS records use hostnames or IP addresses, not page paths such as /home or full URLs beginning with https://.
  • Forgetting the alternate hostname: A site may work at the root domain but fail at www, or the reverse, if both are not configured.
  • Testing only on one device: Local caches, browser caches, and network-level DNS caches can hide the current state.
  • Activating SSL too early or ignoring it afterward: Wait for the domain to point to the correct host, then verify HTTPS, redirects, forms, images, and scripts.
  • Deleting the old site immediately: Keep a rollback option until critical pages and services have been checked across the new setup.

When to revisit

Return to this checklist whenever the underlying setup changes. That includes moving to a new hosting platform, changing a website builder, adding a subdomain, migrating email, replacing an SSL configuration, or switching DNS providers. It is also useful before seasonal planning cycles, major campaigns, and planned site redesigns, when a small configuration error can affect an important period.

Before making any change, capture the current DNS zone and record the intended final state. After the change, verify the root domain, www, email delivery, SSL, redirects, forms, and key third-party integrations. Save the date, the person who made the change, and the reason for it in your site documentation.

For the final launch pass, compare this guide with the website performance and technical SEO checklist. Once the domain resolves correctly, the site is served securely, and email remains functional, you have a reliable foundation for ongoing website maintenance.

Related Topics

#domains#DNS#website launch#nameservers#SSL#email setup#troubleshooting
C

Cloud Site Studio Editorial Team

Technical SEO and Hosting Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.