Connect a Domain to Your Website - Nameservers, DNS Records and Fixes (2026)

Connecting a domain to a website sounds technical, but it usually means copying two or three values from your host into your domain settings. Here's how it works.

On This Page
  1. How Domains and Websites Fit Together
  2. Option 1: Change Nameservers
  3. Option 2: Add DNS Records
  4. Step by Step
  5. Root Domain vs the WWW Version
  6. Connecting to Popular Platforms
  7. Why Changes Take Time
  8. Fixing Common Errors
  9. Subdomains for Different Services
  10. Checking Your Setup
  11. Don't Break Your Email
  12. Connecting a Domain FAQs

How Domains and Websites Fit Together

Your domain is the address. Your website lives on a server, run by a host or a website platform. DNS, the domain name system, connects the two by telling browsers which server to visit when someone types your domain.

To connect them, you change your domain's DNS settings so they point to your host. You can do this in one of two ways.

Option 1: Change Nameservers

Illustration of DNS records connecting a domain to a web server

Nameservers decide who manages your domain's DNS. If you switch them to your host's nameservers, the host manages all records for you, including the website, and often email too.

Option 2: Add DNS Records

If you'd rather keep DNS where it is, add the specific records your host provides. This is common when you use different providers for your website and email.

Common DNS records for websites
RecordWhat it doesTypical use
APoints a name to an IPv4 addressRoot domain to your host's server
AAAAPoints a name to an IPv6 addressOptional, if your host supports IPv6
CNAMEPoints one name to another namewww to your host's address
TXTHolds text valuesOwnership verification
MXDirects emailYour email provider

Step by Step

  1. Add the domain in your host or platformIt will show the records or nameservers to use.
  2. Log in where your DNS is managedUsually your registrar or marketplace account.
  3. Update nameservers or add recordsExactly as your host specifies.
  4. Wait for DNS to updateOften minutes, sometimes up to a day or two.
  5. Turn on SSLMost hosts issue a free certificate automatically once DNS is live.
  6. Choose www or non-wwwAnd redirect the other version to it.

Root Domain vs the WWW Version

Your site can live at yourbrand.com or www.yourbrand.com. Either is fine, but pick one as the main version and redirect the other, so visitors and search engines see one consistent address. Some providers don't allow a CNAME on the root domain, so they give you A records for the root and a CNAME for www.

Website builders, store platforms and static hosts all follow the same pattern: add your domain in their dashboard, then copy the DNS values they give you. Many offer an automatic setup if your registrar supports it. Always use the values shown in your own dashboard, as they can differ by account and change over time.

Why Changes Take Time

DNS records are cached around the internet for a period called the TTL, or time to live. After you make a change, some visitors may still see the old setting until their cache expires. Most changes appear within an hour, but allow up to 48 hours before assuming something's wrong.

Fixing Common Errors

Illustration of a warning sign beside common domain connection errors
Problems and fixes
ProblemLikely causeFix
"Site can't be reached"Records missing or still updatingCheck values and wait
"Not secure" warningSSL not issued yetWait or re-trigger SSL in your host
Old site still showingDNS cacheWait for TTL; clear your browser cache
www works, root doesn'tMissing A recordAdd the root records
Email stopped workingNameserver change dropped MX recordsRecreate MX records at the new DNS host

Subdomains for Different Services

Subdomains let one domain point to several services. You might keep your main site at yourbrand.com, run a store at shop.yourbrand.com, a help center at help.yourbrand.com and a blog at blog.yourbrand.com. Each subdomain usually needs its own CNAME or A record, pointing to the relevant service.

Subdomains keep everything under one brand, which is simpler for customers and builds one recognizable address.

Checking Your Setup

Once DNS has updated, visit both the root and www versions of your domain, on a phone network and on Wi-Fi, to make sure both load the right site with a valid certificate. Online DNS lookup tools show what records the world currently sees, which is helpful when something isn't working.

Don't Break Your Email

The most common accident is switching nameservers and forgetting that email records lived at the old DNS host. Before changing nameservers, note your MX, SPF, DKIM and DMARC records and recreate them at the new host. See business email on your domain.

Connecting a Domain FAQs

Do you need to transfer the domain to your host?

No. You can keep it at your registrar and just update DNS.

How long does it take to connect a domain?

Setup takes minutes. DNS changes usually appear within an hour, sometimes longer.

Can one domain point to two websites?

Not the same address, but subdomains like shop.yourbrand.com can point elsewhere.