{"course":{"slug":"building-apps-with-ai","title":"Building Apps with AI","url":"https://addaly.com/learn/building-apps-with-ai","level":"beginner","track":"build"},"lesson":{"slug":"a-domain-of-your-own","title":"A domain of your own","url":"https://addaly.com/learn/building-apps-with-ai/a-domain-of-your-own","position":47,"of":87,"minutes":8,"answer":"DNS answers are cached for the record's TTL, so a change reaches different devices at different times and 'works on my phone, not my laptop' is normal for an hour.","keyIdea":"DNS answers are cached for the record's TTL, so a change reaches different devices at different times and 'works on my phone, not my laptop' is normal for an hour."},"body":{"format":"markdown","text":"## What you are buying\n\nA 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.\n\nTwo 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.\n\nYour 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.\n\n## DNS in four record types\n\nDNS is a directory that turns a name into an address. Four record types cover nearly everything you will do:\n\n- **A**: a name points to an IPv4 address, such as `76.76.21.21`.\n- **AAAA**: the same, for an IPv6 address.\n- **CNAME**: a name points to another name, such as `cname.vercel-dns.com`, which is then looked up in turn.\n- **TXT**: free text, used to prove you own the domain before a service will act for it.\n\nYour 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.\n\n## Why it works on one device and not another\n\nEvery 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.\n\nSo 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:\n\n```bash\ndig +short example.com\n```\n\nAn online dig tool does the same from a browser, and shows what several resolvers around the world are answering.\n\n## The padlock\n\nHTTPS 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.\n\n## www or not\n\nPick 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.\n\n## Email is a separate system\n\nEmail 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.\n\nSending email from the app (sign-up confirmations, password resets) is yet another system, covered when the app gets accounts.\n\n## Keep the agent out of DNS\n\nA 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.\n\n## Renewal\n\nTurn 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."},"check":{"question":"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?","options":[{"text":"The laptop's DNS resolver still holds the old answer and will until its TTL runs out.","correct":true},{"text":"The record was entered wrongly and needs re-entering exactly as the host's instructions show it.","correct":false,"tempting":"A wrong record would fail on every device; one device working shows the record is correct and the difference is in caching."},{"text":"The certificate has not been issued yet, so the laptop refuses the connection.","correct":false,"tempting":"A missing certificate produces a browser security warning, not a different website."},{"text":"You also need a CNAME record before it works everywhere.","correct":false,"tempting":"A CNAME is for the www name; it has no effect on whether the apex record resolves on a given device."}]},"prev":{"slug":"which-version-is-live","title":"Which version is live","url":"https://addaly.com/learn/building-apps-with-ai/which-version-is-live"},"next":{"slug":"where-the-data-goes-when-the-app-restarts","title":"Where the data goes when the app restarts","url":"https://addaly.com/learn/building-apps-with-ai/where-the-data-goes-when-the-app-restarts"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'A domain of your own', in Building Apps with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-apps-with-ai/a-domain-of-your-own (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"A domain of your own","courseTitle":"Building Apps with AI","module":{"index":5,"slug":"save-points-and-shipping","title":"Save points, and shipping to a stranger"},"answer":null,"keyIdea":"DNS answers are cached for the record’s TTL, so a change reaches different devices at different times and ‘works on my phone, not my laptop’ is normal for an hour.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"what-you-are-buying","runs":[{"text":"What you are buying"}]},{"t":"p","runs":[{"text":"A domain is a yearly rental of a name in a public registry. A "},{"text":".com","code":true},{"text":" costs roughly $10 to $15 a year at registrars that sell near cost: Cloudflare Registrar, Porkbun and Namecheap are the usual three. A "},{"text":".in","code":true},{"text":" is under $10, a "},{"text":".dev","code":true},{"text":" about $12, and "},{"text":".ai","code":true},{"text":" is over $70 because a small island’s registry noticed what the letters meant."}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"Your host’s free subdomain ("},{"text":"app-name.vercel.app","code":true},{"text":") 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."}]},{"t":"h2","id":"dns-in-four-record-types","runs":[{"text":"DNS in four record types"}]},{"t":"p","runs":[{"text":"DNS is a directory that turns a name into an address. Four record types cover nearly everything you will do:"}]},{"t":"ul","items":[[{"text":"A","b":true},{"text":": a name points to an IPv4 address, such as "},{"text":"76.76.21.21","code":true},{"text":"."}],[{"text":"AAAA","b":true},{"text":": the same, for an IPv6 address."}],[{"text":"CNAME","b":true},{"text":": a name points to another name, such as "},{"text":"cname.vercel-dns.com","code":true},{"text":", which is then looked up in turn."}],[{"text":"TXT","b":true},{"text":": free text, used to prove you own the domain before a service will act for it."}]]},{"t":"p","runs":[{"text":"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 ("},{"text":"example.com","code":true},{"text":", called the apex) and a CNAME for "},{"text":"www","code":true},{"text":". 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."}]},{"t":"h2","id":"why-it-works-on-one-device-and-not-another","runs":[{"text":"Why it works on one device and not another"}]},{"t":"p","runs":[{"text":"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."}]},{"t":"p","runs":[{"text":"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:"}]},{"t":"code","lang":"bash","label":"Bash","text":"dig +short example.com"},{"t":"p","runs":[{"text":"An online dig tool does the same from a browser, and shows what several resolvers around the world are answering."}]},{"t":"h2","id":"the-padlock","runs":[{"text":"The padlock"}]},{"t":"p","runs":[{"text":"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."}]},{"t":"h2","id":"www-or-not","runs":[{"text":"www or not"}]},{"t":"p","runs":[{"text":"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."}]},{"t":"h2","id":"email-is-a-separate-system","runs":[{"text":"Email is a separate system"}]},{"t":"p","runs":[{"text":"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 "},{"text":"you@example.com","code":true},{"text":", 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."}]},{"t":"p","runs":[{"text":"Sending email from the app (sign-up confirmations, password resets) is yet another system, covered when the app gets accounts."}]},{"t":"h2","id":"keep-the-agent-out-of-dns","runs":[{"text":"Keep the agent out of DNS"}]},{"t":"p","runs":[{"text":"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."}]},{"t":"h2","id":"renewal","runs":[{"text":"Renewal"}]},{"t":"p","runs":[{"text":"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."}]}],"check":{"question":[{"text":"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?"}],"options":[{"text":[{"text":"The laptop’s DNS resolver still holds the old answer and will until its TTL runs out."}],"correct":true,"tempting":null},{"text":[{"text":"The record was entered wrongly and needs re-entering exactly as the host’s instructions show it."}],"correct":false,"tempting":[{"text":"A wrong record would fail on every device; one device working shows the record is correct and the difference is in caching."}]},{"text":[{"text":"The certificate has not been issued yet, so the laptop refuses the connection."}],"correct":false,"tempting":[{"text":"A missing certificate produces a browser security warning, not a different website."}]},{"text":[{"text":"You also need a CNAME record before it works everywhere."}],"correct":false,"tempting":[{"text":"A CNAME is for the www name; it has no effect on whether the apex record resolves on a given device."}]}],"order":[2,3,0,1],"why":null},"prev":{"slug":"which-version-is-live","title":"Which version is live","minutes":8},"next":{"slug":"where-the-data-goes-when-the-app-restarts","title":"Where the data goes when the app restarts","minutes":8}}}