How to Connect a Domain to Hosting: DNS Records Explained With Setup Examples
DNSnameserversdomain setupwebsite hostingemail DNS

How to Connect a Domain to Hosting: DNS Records Explained With Setup Examples

OOriginally Online Editorial Team
2026-11-13
7 min read

Learn how to connect a domain to hosting with clear DNS examples, email safeguards, propagation checks, redirects, and rollback steps.

Connecting a domain to hosting is mostly a matter of adding the right DNS instructions in the right place. This guide explains nameservers, A and CNAME records, email records, verification records, propagation, redirects, and rollback steps so you can point a website safely without accidentally interrupting email or other services.

Overview

DNS, or the Domain Name System, translates a domain such as example.com into the server addresses and services that power it. Your domain registrar may manage DNS, or DNS may be managed by your hosting provider, a dedicated DNS platform, or another service. Before changing anything, identify which provider is authoritative for the domain. The active nameservers determine where DNS records are controlled.

There are two common ways to connect a domain to web hosting:

  • Change nameservers: Replace the domain’s current nameservers with those supplied by the host. The host then becomes responsible for the domain’s DNS zone. This can be convenient for a new website, but existing records—especially email records—must be recreated or verified before the change.
  • Edit individual records: Keep the current DNS provider and add or update the records supplied by the host. This provides more control and is often preferable when the domain already supports email, subdomains, verification services, or other applications.

Make a simple inventory before editing DNS: the current A, AAAA, CNAME, MX, TXT, and any important redirect or subdomain records. Save a copy of the existing zone if your provider allows it. DNS changes are reversible, but a record that is deleted without being documented can be difficult to reconstruct.

For a broader website launch process, use the Website Launch Checklist for Small Businesses, Creators, and Startups. If you are moving an existing site between hosts, also review the Managed WordPress Hosting Migration Guide.

DNS record reference
RecordPurposeTypical exampleImportant note
APoints a hostname to an IPv4 address@ → 203.0.113.10Use the exact address supplied by the host.
AAAAPoints a hostname to an IPv6 address@ → 2001:db8::10Add it only when the site is correctly configured for IPv6.
CNAMEPoints one hostname to another hostnamewww → example.host.comUsually used for subdomains such as www; do not place it beside conflicting records.
MXDirects email for the domain@ → mail.provider.examplePriority numbers matter when multiple mail servers are listed.
TXTStores verification or policy text@ → verification=...Copy the complete value, including punctuation and quotation handling required by the interface.
NSIdentifies authoritative nameserversns1.dns-provider.exampleUsually changed at the registrar rather than inside the DNS zone.

Checklist by scenario

Scenario 1: A new domain and a new website

  1. Confirm the domain is registered and not subject to a pending verification or transfer lock.
  2. Open the hosting account and locate its domain connection instructions. Record whether it requests nameservers, an IPv4 address, an IPv6 address, a CNAME target, or several of these.
  3. Choose whether the host should manage DNS. If you change nameservers, copy any existing records first.
  4. Add the required A record for the root domain, often shown as @. Add an AAAA record only if the host provides a valid IPv6 destination and the site has been tested over IPv6.
  5. Add the host’s recommended CNAME for www, or create the equivalent record requested by the hosting panel.
  6. In the host’s dashboard, confirm the domain is attached to the correct website and request or enable SSL certificate setup.
  7. Test both example.com and www.example.com. Decide which version should be canonical and configure a redirect from the other version.

Scenario 2: Keep your current DNS provider

This is the safer pattern when the domain already has business email, creator tools, newsletters, analytics, or subdomains.

  1. Leave the existing nameservers unchanged.
  2. Add or update the web host’s A, AAAA, or CNAME records exactly as instructed.
  3. Do not remove MX records merely because you are changing web hosting. MX records control email, not the website.
  4. Keep existing TXT records unless you know they are obsolete. They may verify email services, domain ownership, or security policies.
  5. Ask the hosting provider to confirm that the domain is mapped to the intended site before testing publicly.

Scenario 3: Add or protect email

Obtain the email provider’s exact MX, SPF, DKIM, and—where supplied—DMARC instructions. Add the MX records with the stated priorities. SPF is usually a TXT record, while DKIM commonly uses a provider-supplied selector such as selector1._domainkey. DMARC is normally published at _dmarc as a TXT record.

Do not combine two separate SPF policy strings at the root of a domain. If multiple services send mail, their authorized mechanisms generally need to be combined into one provider-approved SPF record. Because email syntax varies by provider, copy the published value rather than constructing one from memory.

Scenario 4: Verify a third-party service or launch a subdomain

  1. For ownership verification, add the requested TXT record at the host name specified by the service. Some interfaces represent the root as @; others require the full domain.
  2. For a subdomain such as blog.example.com, add the requested A or CNAME record at blog.
  3. Check whether the third-party service also requires the subdomain to be added in its own dashboard.
  4. After verification, retain records that are still required. Remove only records you have confirmed are no longer used.

Scenario 5: Move to a new host with a rollback plan

Lowering the DNS TTL before a planned change may help resolvers refresh sooner, but it does not guarantee immediate worldwide updating. Build and test the new site first, record the old DNS values, then change only the necessary records. Keep the previous values available until the new site, email, SSL, forms, and important integrations have been checked. If the launch fails, restore the previous records and investigate before trying again.

What to double-check

  • Where DNS is managed: Look up the domain’s current nameservers. Editing records at the registrar will not help if another provider is authoritative.
  • Record names: A provider may ask for @, a blank host field, or the full domain. Follow the receiving interface’s format to avoid duplicating the domain name.
  • Conflicts: A hostname should not have an ordinary CNAME alongside an A, AAAA, or another CNAME record. Remove or replace the conflicting entry only after confirming its purpose.
  • Root and www behavior: Configure both hostnames deliberately. A working root domain does not automatically mean the www version works.
  • Email continuity: Check MX, SPF, DKIM, and DMARC before and after a nameserver change. Send and receive a test message using the relevant mailboxes.
  • SSL: DNS pointing and SSL certificate issuance are separate steps. A site may resolve while showing a certificate warning if the host has not issued or installed SSL for the exact domain variants in use.
  • Propagation: Some users may see the old destination while others see the new one. Test through more than one network or DNS-checking tool, but treat third-party results as observations rather than proof that every resolver has updated.

Common mistakes

Changing nameservers without copying email records is one of the most disruptive errors. The website may load while incoming email stops because the new DNS zone has no MX records. Export or document the zone before switching control.

Using the wrong record type can also prevent a connection. An IP address belongs in an A or AAAA record; a hostname supplied as a destination usually belongs in a CNAME. Do not turn a hostname into an A record unless the provider specifically gives you an IP address.

Adding a second SPF record can make email authentication unreliable. Ask the mail provider how to combine policies instead of publishing separate SPF TXT records.

Assuming propagation is a fixed timer leads to unnecessary repeated edits. Repeatedly changing a record can make diagnosis harder. Confirm the authoritative answer, check the TTL, and wait for caches to refresh before making another change.

Forgetting the hosting dashboard is another common issue. DNS may be correct, but the host may still need the domain assigned to a site, a certificate requested, or a redirect selected.

When to revisit

Return to this checklist whenever you connect a new domain, launch a subdomain, change web hosts, add business email, verify a publishing or analytics platform, or investigate a “domain not pointing to website” report. Revisit it before seasonal launch cycles and planned migrations, when there is time to document records and test a rollback.

Hosting and DNS control panels change their labels and workflows, so confirm the current provider instructions before acting. Also review IPv6 guidance, SSL setup steps, email-provider examples, and security-record syntax when a provider updates its documentation. A quarterly technical review is a practical cadence for sites that depend on several connected services.

Your final action checklist is simple: identify the authoritative nameservers, save the current records, apply only the records required by the host, preserve email and verification records, configure SSL and redirects, test both root and www versions, and keep the old values until the new setup is confirmed. For related domain changes, see the domain transfer checklist and the domain renewal and expiration guide.

Related Topics

#DNS#nameservers#domain setup#website hosting#email DNS
O

Originally Online Editorial Team

SEO Editor

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.