Connect a Custom Domain: DNS Records Explained Simply
A, CNAME, and TXT records in plain words, root versus www domains, how long DNS changes take, and how to connect a domain to Vercel, Netlify, or Pages.
By UndieGravity, , 2 min read
Your site is deployed at an address like my-site.netlify.app, and you want example.com instead. Connecting them means adding a few DNS records at the company where you bought the domain. It looks technical, but there are only three record types you need to know.
What DNS does
DNS is the internet's address book. When someone types your domain, their browser asks DNS where to go, and your records give the answer: an IP address or another host name.
The three records you need
- A record: points a name to an IPv4 address, such as
76.76.21.21. Used for the root domain (example.com). - CNAME record: points a name to another name, such as
my-site.netlify.app. Used for subdomains likewww. - TXT record: holds text, usually to prove you own the domain (for hosting, email, or Search Console).
Root domain versus www
A root domain cannot normally use a CNAME, so it uses A records. Some DNS providers offer ALIAS or ANAME records, or CNAME flattening, which act like a CNAME at the root. Your host's instructions say which to use.
Pick one main address and redirect the other to it. Most hosts set this up when you add both versions in their dashboard.
Step by step
- Add the domain in your host's dashboard (Vercel, Netlify, or GitHub Pages settings).
- Copy the records the host shows you.
- At your registrar, open the DNS settings and add those exact records. Delete old records for the same names that point elsewhere.
- Wait, then check the host's dashboard until the domain shows as verified.
- HTTPS is issued automatically once the domain points to the host.
How long does it take?
Often a few minutes, sometimes up to 48 hours. Each record has a TTL (time to live) that says how long other servers may cache the old answer. Lower the TTL a day before a planned move to make the switch faster.
Do not break your email
If you use email on the same domain, leave the MX records and any email TXT records (SPF, DKIM) alone. Changing website records does not affect email unless you delete those.
Check your records
nslookup example.com
nslookup -type=CNAME www.example.com