Skip to content
DeployAI
Domains

How to connect a domain to a website: CNAME, A and email

Point a domain at your site with a CNAME for www, or move the nameservers. What A, CNAME and MX do, how to keep email working, and how long it takes.

8 minute read

A CNAME DNS record pointing www at the site's address, beside the title how to connect a domain to a website.

To connect a domain to a website, you change its DNS so the name points at the company that hosts your site. There are two ways: add one or two records (usually a CNAME for www) at the place that manages your DNS today, or move the whole DNS management to your host by changing the nameservers. Either way, keep your email records as they are, and expect the change to show within minutes to a few hours, sometimes up to 48 hours.

Domain, registrar and DNS in plain words

A domain is the name people type, like yourbusiness.co.il or yourbusiness.com. You do not own it forever. You rent it for a year or more, and you renew it.

A registrar is the company you rent the domain from. For .co.il and the other Israeli endings, that is one of the registrars accredited by the Israel Internet Association. For .com, it is any of many international companies. The registrar is where you renew, where your contact details sit, and where you choose which nameservers the domain uses.

DNS is the address book of the internet. It holds records that say where the site lives, where the email goes, and which services may act for the domain. The company that runs this address book for your domain is your DNS host. Often it is the registrar itself, but it can be your old web host, Cloudflare, or the company that hosts your new site.

So there are three separate questions: who you rent the name from, who runs its DNS, and who hosts the site. Many problems start when these get mixed up. If you are not sure, the domain check shows where a domain's DNS is managed today, which registrar holds it, and which company runs its email.

The two ways to connect a domain

Way 1: point records at the host. Your DNS stays where it is. You log in there and add or change one or two records that your new host gives you. Everything else, including email, stays untouched. This is the smallest change and the easiest to undo.

Way 2: move the DNS management. You change the nameservers at the registrar to the ones your host gives you. From then on, the host runs the whole address book. This is handy when you want one place for everything, but every record you had before must exist at the new place first. A record that is not copied simply stops working, and the most common victim is email.

Neither way is better for everyone. If your email and other services are set up at your current DNS host and you are happy there, Way 1 is enough. If your DNS sits with an old web host you want to leave, Way 2 lets you leave cleanly.

A, CNAME, the bare domain and www

The records you will meet most when connecting a site are A and CNAME.

  • An A record points a name at an IP address, a row of numbers like 192.0.2.10.
  • A CNAME record points a name at another name, like shop.freesite.click. If the host ever changes its IP addresses, a CNAME follows on its own.

Your domain has two common forms. The bare domain is yourbusiness.co.il with nothing before it (in DNS screens it often shows as @). The www form is www.yourbusiness.co.il.

Here is the catch: the DNS rules do not allow a CNAME on the bare domain, because the bare domain also holds other records, like email. Some DNS hosts work around it with their own record type (often called ALIAS, ANAME or CNAME flattening), but not all do.

That is why a common answer is:

  1. Put the site on www with a CNAME to the address your host gives you.
  2. Forward the bare domain to www at your registrar or DNS host. Most of them offer domain forwarding in their settings.

Visitors who type either form reach the same site, and you never need to touch the bare domain's other records.

Common DNS records and what each does

RecordWhat it doesExample
APoints a name at an IPv4 address@ to 192.0.2.10
AAAAPoints a name at an IPv6 address@ to 2001:db8::10
CNAMEPoints a name at another namewww to shop.freesite.click
MXSays which servers receive email for the domain@ to your mail provider
TXTHolds text that proves ownership or protects emailSPF, DKIM, a verification code

You may also see NS records (the nameservers) and CAA records (which companies may issue security certificates for the domain). A CAA record that does not list your new host can block its certificate, so check it if SSL does not come on.

Email: the records that must stay

Your website and your email are separate, even when they share a domain. Email depends on the MX records, and usually on a few TXT records for SPF and DKIM. If they are deleted or not copied, email stops arriving, often without any error you would notice right away.

Before you change anything:

  1. Write down or screenshot every record at your current DNS host.
  2. Find the MX and TXT records and note which company they point to (Google Workspace, Microsoft 365, Zoho, your old web host and so on).
  3. If your mailboxes live at your old web host, do not cancel that hosting until the mail has a new home. Cancelling it ends the mailboxes, whatever DNS says.

With Way 1 you only touch the site records, so email is safe as long as you leave MX and TXT alone. With Way 2, every one of these records has to exist at the new DNS host before you change the nameservers.

Waiting time, SSL and DNSSEC

Waiting time. DNS changes usually show within minutes to a few hours. Sometimes it takes up to 48 hours, because computers around the world keep the old answer for a while (the TTL value on each record says how long). During this time some visitors see the old site and some see the new one. That is normal. Plan the change for a quiet day, and do not change it back and forth.

SSL. SSL is what puts the lock and https in the address bar. Most hosts issue a free certificate on their own once the domain points at them, so it comes on a little after the DNS change. If the site opens with a warning at first, wait a bit before changing anything.

DNSSEC. DNSSEC is a security layer that signs your DNS answers. It is set at the registrar and is tied to your current DNS host. If you move the DNS (Way 2) while DNSSEC is still on with the old host's details, the domain can stop working for everyone. Check at your registrar whether DNSSEC is on. If it is, turn it off before you change the nameservers, wait the time your registrar says, and turn it on again later with the new host's details if the new host supports it.

Common mistakes

  • Deleting MX or TXT records while cleaning up, or moving the DNS without copying them. Email stops.
  • Cancelling the old hosting too early when the mailboxes live there.
  • Typing the full domain in the name field. Many DNS screens add your domain on their own, so www.yourbusiness.co.il becomes www.yourbusiness.co.il.yourbusiness.co.il. Usually you type only www.
  • Leaving an old A record next to the new one for the same name. Visitors then land on either site at random.
  • Changing nameservers with DNSSEC still on.
  • Connecting only one form. You set up www and forget the bare domain, or the other way round. Check both.
  • Letting the domain expire. Keep the renewal date and your registrar login somewhere safe. No DNS setting helps a domain that has run out.

Connecting a domain with DeployAI

If your site is hosted on DeployAI, connecting your own domain is part of the paid plans (from 39 ILS a month before VAT). Every site also gets a free address on DeployAI's sites domain, so a site can be live before you connect a domain at all.

DeployAI offers the same two ways described above:

  • Move the DNS to DeployAI. Every record you have is copied, and the email records are checked first. Then you change the two nameservers at your registrar once. After that you edit records on a DNS records page in the dashboard, and you can use email forwarding.
  • Add one record at your current DNS host, and leave everything else where it is.

After that, DeployAI checks the domain by itself. When it is connected, the site gets SSL, and you get an email saying it is live. Sites on DeployAI are https only: plain http moves to https. For a bare domain, DeployAI recommends the common answer from above: www with a CNAME, plus forwarding of the bare domain at the registrar.

DeployAI does not host mailboxes. It can forward addresses on a domain whose DNS is with it, or connect Google Workspace, Microsoft 365 or Zoho Mail, which you buy from them. If you already have mailboxes, they keep working as long as their records stay.

The exact product steps, screen by screen, are in the connect domain help page. Before you start, run the domain check to see where your DNS and email are today. If your site is not live yet, the go live guide covers that first step, and if you are leaving Wix or WordPress, read moving without losing Google before you touch the domain. Plan prices are on the pricing page.

Questions

What is the difference between an A record and a CNAME?

An A record points a name at an IP address. A CNAME points a name at another name and follows the host if its addresses change. Most DNS hosts do not allow a CNAME on the bare domain.

How long does it take to point a domain to a website?

Usually minutes to a few hours. Sometimes up to 48 hours, because computers around the world keep the old answer for a while.

Will connecting my domain to a new site break my email?

Not if the MX and TXT records stay as they are. Email breaks when they are deleted, or when the DNS is moved without copying them.

Should I use www or the bare domain?

A common answer is to put the site on www with a CNAME and forward the bare domain to www at your registrar. Visitors reach the same site either way.

Do I need to turn off DNSSEC before moving DNS?

If DNSSEC is on at your registrar and you change the nameservers, yes, or the domain can stop working. Turn it on again later with the new host's details.

Every plan includes hosting, a secure address and visit stats.

Pick a plan

More guides