What you are buying
A domain is a yearly rental of a name in a public registry. A .com costs roughly $10 to $15 a year at registrars that sell near cost: Cloudflare Registrar, Porkbun and Namecheap are the usual three. A .in is under $10, a .dev about $12, and .ai is over $70 because a small island’s registry noticed what the letters meant.
Two things to check before paying. The renewal price, which is often double the first-year price on the flashier registrars. And that WHOIS privacy is included, so your home address is not published in the registry: the three named above include it free.
Your host’s free subdomain (app-name.vercel.app) works fine and costs nothing. Buy a domain when a stranger is going to type the address, or when you want the app to survive a change of host without every link breaking.
DNS in four record types
DNS is a directory that turns a name into an address. Four record types cover nearly everything you will do:
- A: a name points to an IPv4 address, such as
76.76.21.21. - AAAA: the same, for an IPv6 address.
- CNAME: a name points to another name, such as
cname.vercel-dns.com, which is then looked up in turn. - TXT: free text, used to prove you own the domain before a service will act for it.
Your host tells you exactly which records to create; copy them rather than improvising. The usual pattern is an A record for the bare domain (example.com, called the apex) and a CNAME for www. The apex cannot be a CNAME under the DNS rules, which is why hosts give an IP address for it. Cloudflare’s DNS bends this with a feature it calls flattening, which is the reason it can offer a CNAME at the apex when others cannot.
Why it works on one device and not another
Every DNS record carries a TTL, a number of seconds for which any resolver may cache the answer. Your laptop asked yesterday and was told “parking page”, and it will keep believing that until the TTL expires. Your phone, on mobile data, asked a different resolver that had never seen the name and got the new answer at once.
So a change takes up to the old TTL to reach everyone, commonly an hour, sometimes a day for records set with a long TTL. Nothing is wrong. Do not change the record again while waiting; each change restarts the wait for somebody. To see what the world currently answers:
dig +short example.comAn online dig tool does the same from a browser, and shows what several resolvers around the world are answering.
The padlock
HTTPS is automatic on Vercel, Netlify, Cloudflare Pages and Render. Once the DNS resolves to them, they request a certificate from Let’s Encrypt on your behalf, which takes a few minutes. A certificate warning in the first quarter of an hour after the DNS change is expected and resolves itself; a warning a day later means the DNS is not pointing where the host thinks.
www or not
Pick one and redirect the other. The host does the redirect; you only decide. Choosing neither means two addresses that both work and share nothing: separate cookies, separate sessions, and users logged in on one and not the other.
Email is a separate system
Email for a domain is routed by MX records, which have nothing to do with the A and CNAME records above. Adding a website does not give you you@example.com, and, more importantly, adding a website must not touch the MX records if email already exists: that is how a business loses a day of mail while launching a page. Cloudflare’s Email Routing forwards addresses on your domain to an existing inbox free of charge, if you want an address without a mail service.
Sending email from the app (sign-up confirmations, password resets) is yet another system, covered when the app gets accounts.
Keep the agent out of DNS
A wrong record takes the site down for the length of the TTL, which is the one class of mistake that cannot be undone quickly. Make DNS changes yourself, from the host’s exact instructions, and keep the registrar login out of any tool’s reach.
Renewal
Turn auto-renew on and keep the card valid. An expired domain enters a grace period, then goes to auction, and names with any traffic are bought by squatters who will offer it back to you at several hundred times the price. This has happened to companies with lawyers; it is not going to spare a side project.
Every lesson here is open. Your progress is recorded once you pass the Building with AI exam.
Check your understanding
You add the A record the host asked for. The site loads on your phone, but your laptop still shows the registrar’s parking page. What is happening?
Pick the one you would defend. Your answer stays private.
Stuck on something?Ask Beatriz, your AI tutor
