How to connect a domain to a website
Point the domain's DNS at your host and wait. Which record you use depends on what the host gives you: an A record if it gives you an IP address, a CNAME if it gives you a hostname and you are configuring a subdomain like www, and an ALIAS or ANAME if it gives you a hostname and you need the bare domain — because the DNS specification does not allow a CNAME at the apex. Changes are usually live in minutes; the delay people call "propagation" is mostly the TTL on the record you replaced.
Step one: find out what your host gives you
Every connection method follows from this. Your host's setup page will give you either an IP address (four numbers, or an IPv6 string) or a hostname (something like yoursite.hostplatform.net). Which one you get decides everything below.
The records, and when each applies
Set these at whoever runs your DNS — usually your registrar, unless you have moved it.
- A record — maps a name to an IPv4 address. Use when the host gave you an IP. Add an AAAA record too if it gave you an IPv6 address.
- CNAME — maps one name to another name. Use for www or any other subdomain when the host gave you a hostname.
- ALIAS or ANAME — behaves like a CNAME but is legal at the apex. Use when the host gave you a hostname and you need example.com rather than www.example.com.
- MX — email only. Changing your website records does not affect email, and changing MX records does not affect the website.
Why a CNAME will not work on the bare domain
This is the single most common wall people hit, and it is not your registrar being difficult. The DNS specification does not allow a CNAME to coexist with other records on the same name, and the apex of a domain must carry NS and SOA records. So a CNAME at the apex is invalid, and a well-behaved DNS provider will refuse it.
ALIAS and ANAME are the workaround: the DNS provider resolves the target behind the scenes and answers with an address record, which is legal. Support is not universal — of the registrars we track, Porkbun documents ALIAS explicitly — so if your platform requires a hostname at the apex, check for it before you commit to a registrar.
How long it takes, and what actually causes the wait
Publishing a new record is close to instant. What takes time is resolvers that already cached the old answer and will keep serving it until its TTL expires — so the practical wait is roughly the TTL of the record you replaced, not a mysterious global propagation.
If you know a change is coming, lower the TTL on the existing record a day ahead. The old value expires from caches quickly, and the switch is then near-immediate. Check the result with a DNS lookup rather than by loading the site in the browser you have been testing in, which will have its own cache and its own opinion.
The traps worth knowing before you start
Most connection problems are one of these four.
- Editing DNS at the wrong place — if your nameservers point at a third party, records set at the registrar do nothing at all
- Forgetting www — connecting the apex and not the subdomain, or the reverse, leaves half your visitors on a broken address
- An HTTPS certificate that has not caught up — many platforms only issue one after DNS resolves, so a warning immediately after the switch often resolves itself within the hour
- Leaving an old A record in place beside the new one — DNS will happily answer with both, sending some visitors to the old server
Connect a domain to a website
- 1Get the target from your hostFind the host's DNS setup page and note whether it gives you an IP address or a hostname. Copy the exact values.
- 2Confirm where your DNS is actually managedCheck the domain's nameservers at your registrar. If they point somewhere else — a host, or Cloudflare — that is where the records must be set.
- 3Lower the TTL first, if you can plan aheadA day before the change, set the existing record's TTL low. This shortens the window in which resolvers keep serving the old answer.
- 4Add the right recordAn A record for an IP; a CNAME for a subdomain pointed at a hostname; ALIAS or ANAME for the apex pointed at a hostname. Remove any old record for the same name rather than leaving both.
- 5Cover both the apex and wwwPoint both, so visitors reach the site whichever they type. Most platforms document a redirect from one to the other.
- 6Verify with a DNS lookupQuery the record directly rather than loading the site in a browser you have been testing in. Once it returns the new value, wait for HTTPS to be issued if the platform handles certificates itself.
To connect a domain to a website, set a DNS record pointing at the host: an A record (and AAAA for IPv6) when the host provides an IP address, a CNAME when it provides a hostname and the target is a subdomain such as www, or an ALIAS/ANAME when it provides a hostname and the target is the bare apex domain. A CNAME cannot be used at the apex because the DNS specification forbids a CNAME coexisting with the NS and SOA records the apex must carry; ALIAS/ANAME resolves the target behind the scenes and answers with an address record instead. Records must be set wherever the domain's nameservers point, which is not always the registrar. Perceived propagation delay is primarily the TTL of the replaced record; lowering the TTL in advance shortens it.