Back to Explore
GuideVibeFix editorialUpdated Nov 11, 2026

Don't Let Your Domain Fail on Launch Day: Custom Domains and SSL for Vibe Projects

A domain problem is not a bug in one feature — the whole site goes dark. This guide covers the domain handover: the three DNS record types, the apex problem and its four fixes, three certificate verification methods, and a 6-step, 75-minute path to full HTTPS.

Rows of black server racks with blinking lights in a data center

First, the boundaries, so you don't read the wrong article: the site already has a guide on multi-tenancy isolation, which is about how one platform gives many tenants their own domains and how to choose routing; and there are deployment guides about how code ships. This article covers the stretch in between that usually gets skipped — how your own domain gets connected, and how the certificate stays out of trouble. One judgment up front: domains and certificates are the part of a vibe project that involves the least code and causes the most spectacular failures. AI can write your whole product overnight, but it will not click through the DNS panel for you, and it will not wake you up the morning your certificate expires. When the domain breaks, it is not one feature that breaks — the whole site goes dark, users see a red browser warning, and they cannot even reach your error page.

Rows of black server racks with blinking lights in a data center

Four things to decide before you buy a domain

Most people buy a domain on instinct: it looks nice, they pay. A domain is expensive to rename — every backlink, every search-engine listing, every word-of-mouth mention has to start over. Run through these four things before paying:

First, it must be speakable and typeable. The test for a good domain is not whether it looks cool, but whether someone can spell it correctly after hearing it once on the phone. Drop hyphens and numbers; shorter is better; anything over 15 characters deserves a second thought. Say it three times, spell it three times — if you cannot spell it, change it. Your domain will be spoken aloud on podcasts, in videos, and at meetups. Spelling cost is customer-acquisition cost.

Second, look at the renewal price, not the first-year price. Many registrars charge $1 for the first year and $30 to renew, and you only find out after two years when switching is already painful. Check the renewal price before buying, multiply by 5 years, and do the math. One more trap: so-called "premium domains" can cost thousands of dollars in the first year — read every line of small print on the checkout page.

Third, turn on privacy protection by default. Domain registration details are public by default. Without privacy protection, your name, email, and phone number sit in WHOIS for anyone to harvest, and the spam arrives the same day. Most registrars include privacy protection for free now — confirm it is switched on when you buy, not after you start getting harassed.

Fourth, don't get exotic with the suffix. If .com is taken, fall back to .dev, .app, or .io, then to a country suffix. Don't pick an obscure suffix for the sake of looking cool — users won't remember it and some email systems won't accept it. One hard rule: .dev and .app enforce HTTPS — before the certificate is ready, the site won't even load over HTTP, so don't let that trap catch you while you are still debugging.

The three DNS record types: A, CNAME, and TXT

Here is a fictional example. The product "Tide Journal," the developer "Xiao-Man," and the domain chaoxi.example below are fictional, and the numbers are made up to make the problem clear — they are not data from a real project. Xiao-Man's product ran fine on the platform's subdomain, and the day before launch he decided to switch to his own domain. Six hours later it still wasn't working — not because he was careless, but because he had mixed up the three record types. Here they are, once and for all:

Record typeWhat it doesWhat the value looks likeWhat happens if you get it wrong
A / AAAAPoints a domain straight at a server's IP addressAn IPv4 or IPv6 address, e.g. 203.0.113.10The site won't open, or opens someone else's server
CNAMEPoints a domain at another domain, which decides the final IPAnother domain name, e.g. cname.vercel-dns.comResolution loop, or pointing at a hostname that doesn't exist
TXTSticks a "note" on the domain for others to verifyArbitrary text, e.g. the random string used for certificate verificationThe certificate won't issue, or your mail gets flagged as spam

The division of labor in one sentence: an A record is an "address," a CNAME is a "forward," a TXT record is a "note." Xiao-Man's first mistake that day was putting the CNAME value the hosting platform gave him into an A record — the platform gave him a domain name, and he typed it into a field that only accepts IP addresses, so of course nothing resolved. His second mistake was setting the TTL to 86400 seconds (24 hours): every mistake then took a full day before the next fix could take effect. The iron rule for beginners: before you touch anything, set the TTL to 300 seconds (5 minutes), and only switch it back to 3600 seconds once everything works. A 5-minute TTL means every mistake costs you at most 5 minutes to retry.

One more thing that is easy to miss: DNS records have a "host" field. @ means the root domain itself (chaoxi.example), www means www.chaoxi.example, app means app.chaoxi.example. Many people configure www and forget @, so users who type the bare domain get nothing — or the other way around. The correct approach: configure both the root and www, and 301-redirect one to the other, so the whole site has exactly one canonical address. Search engines and users' bookmarks will thank you.

The apex problem: why the root domain can't take a CNAME directly

This is the most counterintuitive rule in DNS, and the one where beginners get stuck longest: the apex — the root domain with no prefix, chaoxi.example — cannot take a CNAME directly. It is not the hosting platform being difficult; it is the DNS protocol itself. The apex must carry SOA and NS records, and a CNAME by definition forbids any other record on the same name. The two rules collide. So to point your apex at a hosting platform, there are four solutions, each with trade-offs:

  • Solution one: an A record pointing at a fixed IP. The most direct option, but it needs the hosting platform to give you a fixed IP. Many modern platforms (Vercel, Netlify, Cloudflare Pages) use edge IPs that change at any time and don't hand out a fixed address — so this road is closed.
  • Solution two: ALIAS / ANAME records. A "CNAME-like" record offered by some DNS providers: you write it on the apex, and the provider resolves it to an IP behind the scenes. This is the first choice for the apex, but only if your DNS provider supports it — Cloudflare, DNSPod, and Route 53 all do, under different names, so check your provider's docs.
  • Solution three: CNAME flattening. Cloudflare's name for it: you write a CNAME on the apex, and it resolves to an A record in real time at the edge. Same effect as solution two, different name. If you already use Cloudflare, this is the zero-cost answer.
  • Solution four: 301-redirect the apex to www. The apex itself only runs a redirect service (many DNS providers offer "URL forwarding" for free), every request to the apex 301-redirects to www.chaoxi.example, and the real content lives only on www. This is the most old-fashioned but most reliable method, and it suits anyone who doesn't want to move DNS providers.

The rule for choosing is a single sentence: use whatever your DNS provider supports; don't move house just to use a particular solution. Moving itself causes another resolution outage, and the benefit isn't worth the risk. There is exactly one exception: if your current DNS provider supports neither ALIAS nor URL forwarding, then it really is time to switch — that is infrastructure debt, and the sooner you pay it, the better.

How to split subdomains: decide once, in one table

Once the main domain is connected, the next question is how to divide subdomains. Many vibe projects add one whenever they think of it, and six months later api2.chaoxi.example and newapp.chaoxi.example are flying around and nobody remembers which ones are live. Decide the split when you first connect the domain, write it down, and only open new subdomains according to the table:

SubdomainPurposeNotes
Root / wwwThe main product sitePick one as canonical; 301-redirect the other
appThe logged-in application itselfSeparate from the marketing page, so it can deploy independently later
apiThe public APICross-origin policy and CORS live here only, not on the main site
docsThe documentation siteCan live on a different hosting platform; resolution is independent
statusThe status pageIt must still open when the main site is down — ideally a different provider

This table has a second benefit: the wildcard-certificate decision now has a basis. If you only use the main site and app, two single-domain certificates are enough; when you get to a fourth subdomain, switching to a wildcard certificate is still not too late. The number of subdomains decides the shape of the certificate, not the other way around. And one more note: putting the status page on a different provider is not fussiness — on the day the main site goes down, it is the only "we're fixing it" page your users can see. Hosting it with the main site is the same as having no status page at all.

Three ways to verify a certificate: pick wrong and it won't issue

Once the domain resolves, the next step is the certificate. The little padlock in the browser's address bar is a TLS certificate, and before issuing one, the certificate authority has to verify that the domain is really yours. There are three verification methods, and picking the wrong one can cost you a whole day:

MethodHow it verifiesBest forWeakness
HTTP-01Places a specific file in the website root; the authority fetches itWhen the site is already reachable over HTTP — the most common caseFails easily if the site isn't live yet or has redirects in the way
DNS-01Adds a TXT record to DNS; the authority looks it upWildcard certificates (*.chaoxi.example), or when the site isn't live yetSlow — you wait for DNS propagation — and easy to paste into the wrong record
TLS-ALPN-01Answers a special challenge during the TLS handshakeWhen port 443 is already taken and HTTP verification can't workMost hosting platforms don't support it; only useful on your own server

The advice for a one-person team is blunt: if your hosting platform offers automatic certificates, use them and never sign one yourself. Vercel, Netlify, Cloudflare Pages, and Fly.io issue and renew certificates automatically once you point the domain at them — you never touch anything. Signing your own certificate (for example with certbot and Let's Encrypt) is worth it in exactly one situation: your service doesn't live on one of these platforms, such as a VPS you maintain yourself. Let's Encrypt certificates last only 90 days, which means 4 renewals a year — and every time the renewal script breaks, the site breaks with it. Do that math first.

One more judgment call: a wildcard certificate (*.chaoxi.example) has only one verification method — DNS-01. If you plan to run app.chaoxi.example, api.chaoxi.example, and docs.chaoxi.example one day, one wildcard certificate covers them all and saves you from issuing one per subdomain. But the price is that every renewal needs a TXT record change — unless your DNS provider's API does it automatically, don't chase that convenience.

One picture: 6 steps and 75 minutes from buying a domain to full HTTPS

Stringing the above into one timeline, our fictional example "Tide Journal" took 75 minutes across 6 steps the first time it connected a domain. That number is not an industry standard — it is the sum of the budget in the table below. Walk through it with this much time set aside, and you won't be scrambling on launch day:

From buying a domain to full-site HTTPS: 6 steps, 75 minutes

StepWhat to doBudget (minutes)
1Buy the domain and pick a DNS provider5
2Configure DNS records (A/CNAME + www redirect)10
3Wait for DNS propagation (with TTL at 300 seconds)30
4Issue the certificate (automatic on the hosting platform)5
5Configure the 301 redirect between www and the apex10
6Verify the whole chain (the 4 commands in the next section)15
Total6 steps75

The step to notice is number 3: waiting 30 minutes for DNS propagation is the longest step of all, and there is nothing you can do but wait. So the right workflow is: set the TTL to 300 seconds, configure the records, then go do something else — write the changelog, answer user mail — and come back to verify after 30 minutes. Staring at the terminal and pinging repeatedly buys nothing but anxiety. On the other hand, if it still doesn't resolve after 30 minutes, stop waiting and check the next two sections: most likely a record is in the wrong place, or the wrong verification method was chosen.

Five common reasons renewals fail: check before the certificate expires

A certificate never expires without warning — it starts sending warning emails 30 days ahead, and again 7 days ahead. The people whose certificates actually expire are the ones who treat those warnings as spam. But even if you see the warnings, renewal can still fail. Here are the 5 most common reasons, in order of frequency:

  1. The DNS records were changed. Someone touched an A record or CNAME, and HTTP-01 verification went to fetch the file from the wrong server. Before renewing, confirm the resolution hasn't changed.
  2. The HTTP redirect is too aggressive. Forcing all traffic to HTTPS is fine, but if the /.well-known/ path gets redirected too, the authority can't fetch the file. The fix: the verification path must never redirect.
  3. The DNS-01 TXT record was deleted. The TXT record pasted by hand last time got cleaned up as clutter. Renewal re-verifies from scratch — it doesn't "reuse last time's result" — so the record has to stay there.
  4. The API key expired. If a DNS provider API rewrites the TXT record automatically, an expired key means renewal silently stops. Put the key's expiry in your calendar next to the certificate's expiry.
  5. The server clock is wrong. If the server time is off by more than 5 minutes, certificate verification fails outright. This is the easiest one to overlook: fix the clock before anything else.

Two habits defend against all five: first, a calendar reminder 30 days before the certificate expires, no exceptions; second, run the renewal flow by hand once a year — don't wait until the day it fails automatically to discover the script has been broken for months. The biggest enemy of automatic renewal isn't technology; it's "I assumed it was running."

Certificate chains and mixed content: two reasons the padlock goes grey

The certificate is issued, but the browser padlock is still grey or carries a warning triangle. Don't blame the certificate yet — two causes split the blame evenly. The first is an incomplete certificate chain: certificates come in three levels — the root, the intermediate, and yours — and browsers only accept a complete chain. Some servers ship only their own certificate without the intermediate; desktop browsers that have cached the intermediate can still open the site, while phones and fresh browser installs show a red warning. The way to check is the openssl s_client command from the previous section — see whether it walks the whole chain end to end. The fix is to bundle the intermediate certificate into the same file; check your hosting platform's docs for the exact order instead of guessing.

The second is mixed content: the page itself is HTTPS, but it embeds an image or a script over HTTP. The browser won't block the whole site for that, but the padlock goes grey and the console fills with warnings. AI-generated pages are the worst offenders here — the AI casually writes an http:// image URL and you ship it without checking. The fix is simple: every resource on the site uses a relative path or https://, and before launch, sweep the browser console for mixed-content warnings and leave none behind.

Moving without losing traffic: the 301 migration in six steps

One day you will change domains, or change hosting platforms. The thing to fear in a migration isn't the technology — it's the traffic. Old links are scattered across search engines, users' bookmarks, and other people's articles; once they break, they don't come back. A 301 permanent redirect exists for exactly this. Six steps, and the traffic mostly survives:

  1. Get the site running in the new place first. Verify the new site is fully working with a temporary domain or a hosts-file entry before touching DNS. Once DNS moves, there is no way back.
  2. 301 every old URL to its matching new URL. Not everything to the homepage — sending everything to the homepage tells search engines "the old content is gone," and the ranking is wiped to zero.
  3. Drop the DNS TTL to 300 seconds a day ahead. Do it 24 hours before the move, not on the day. The TTL is "how much longer the old record lives in caches around the world" — changing it on the day is already too late.
  4. Cut DNS over and watch the logs. After the cut, watch the new site's access logs: are requests from the old domain arriving with 301s, and are there any 404s? A 404 means some old URL has no mapping.
  5. Keep the old domain renewed for at least a year. Don't throw the old domain away after migrating. Old links live for years; the moment the domain expires, every backlink breaks at once.
  6. Submit the address change to search engines. Google Search Console and Bing Webmaster Tools both have a "change of address" tool. Submit once, and the re-indexing finishes weeks faster.

Here is a counterintuitive judgment: on migration day, the most dangerous thing is not DNS — it is the few unpopular URLs you assumed were configured but weren't. Everyone checks the homepage and the login page. What breaks is the deep link in a three-year-old blog post, or the link sitting in some user's bookmark folder. That is why step 4 is about watching the 404 log for new old URLs, not about whether the homepage loads.

Troubleshooting: four commands that locate 90% of problems

When the domain won't resolve, don't guess by feel. Run these 4 commands in order, and 90% of problems are located within 5 minutes:

dig chaoxi.example +short        # Check resolution: is the returned IP right?
dig www.chaoxi.example +short    # Check www too — don't only check the apex
curl -I https://chaoxi.example   # Check HTTPS: status code, redirect chain, certificate errors
openssl s_client -connect chaoxi.example:443 -servername chaoxi.example | openssl x509 -noout -dates  # Check the certificate: who it was issued to, when it expires

Read the results in order: if dig returns nothing or the wrong IP, it is a DNS problem — go back and check the records. If dig is right but curl fails, it is a certificate or server problem. If curl works but the browser shows a red warning, the certificate chain is incomplete or the name doesn't match — most commonly, the certificate was issued for www.chaoxi.example only, not the apex. One more trap for beginners: dig queries your local DNS cache, which doesn't represent the rest of the world. If you suspect a caching problem, query a public DNS server — for example dig @8.8.8.8 chaoxi.example — and compare the results.

One last reality check for 2026: more and more of your users open your site on a phone, and mobile browsers are far less forgiving about certificate problems than desktop ones — on desktop you can still click "Advanced, proceed anyway," but on mobile that option is often buried or missing. So "the certificate has a small problem but most users can still get in" doesn't exist: a certificate problem means the whole site is unreachable. Run the 4 commands above before launch, write them into your launch checklist — it is far cheaper than apologizing afterward.

10-item pre-launch checklist

Copy this, run through it, then announce the launch:

  1. Both the apex and www are configured, one 301-redirects to the other, and the whole site has exactly one canonical address.
  2. The TTL was set to 300 seconds before you started, and switched back to 3600 seconds once everything works.
  3. A records contain IP addresses and CNAME records contain domain names — the two were not swapped.
  4. The apex does not carry a CNAME directly — one of the four solutions (ALIAS, flattening, or a 301 redirect) is in place.
  5. The certificate is issued, covers both the apex and www, and the browser padlock is normal.
  6. A wildcard certificate went through DNS-01 verification, and the TXT record is still there — nobody cleaned it up.
  7. A calendar reminder exists 30 days before the certificate expires, and the automatic renewal is run by hand once a year to verify it.
  8. The /.well-known/ verification path is exempt from the site-wide forced-HTTPS redirect.
  9. The dig, curl, and openssl commands have all been run, and the full chain verifies.
  10. If there was a migration, the old domain is renewed for at least another year, and the address change has been submitted to search engines.

One last repeat of the core judgment: domains and certificates are not technically difficult, but they have almost no margin for error. Code can be hotfixed or rolled back; a misconfigured domain takes the whole world a DNS propagation to forget; an expired certificate means you cannot even send the apology — because your website no longer opens. So don't treat it as "something to do quickly before launch." Treat it as the launch itself: 6 steps, 75 minutes, run the checklist, then announce. Those 75 minutes are the best-spent launch time you will ever have.

Views 5Comments 0

Comments (0)

ME
0/1000
Loading comments...
Browse projectsPublish your project

Related articles

Screenshot of Amp's new thread composer: the run-location picker lists Boxes, and the acme/workbench workspace shows the bug-tracker, tiny-crm, team-wiki and incident-database apps
News
An $18-a-Month Home for Agent-Built Software: Amp's Boxes Fill In the Last Missing Piece

On 10 November 2026, Amp launched Boxes: always-on mini-computers from $18 a month for deploying software you built with an agent. Each box runs its own runner, so the agent can edit live production data right there; the same month Amp also shipped Spaces, retired the Dial, and arrived on Windows — the agent's workplace is moving off the laptop into the cloud.

Developer WorkflowProduct LaunchDeployment
Real photo: a bank of light gray metal filing cabinets with one drawer pulled open, revealing rows of hanging file folders inside
Guide
A real database inside the browser: IndexedDB local storage, explained plainly

localStorage only stores strings and has no indexes. IndexedDB is a real database in the browser: structured data, far larger capacity, indexes, and transactions. Following MDN's Using IndexedDB, IDBDatabase, and IDBObjectStore: the five-step routine, opening, upgrades, keys, indexes, transactions, add versus put, get, cursors, ranges, and multi-tab upgrades.

Tool TipsData WorkflowsFrontend Engineering
Real photo: hands typing on a MacBook Pro showing JavaScript code that changes HTML content, with a white mouse, papers, and binders on a white desk
Guide
Functions without the confusion: JavaScript functions, parameters, and arrow functions, explained plainly

You already call functions every day; this guide names what you have been doing. Following MDN's Functions, Arrow function expressions, and Rest parameters: declarations versus expressions, parameters and arguments, default values, rest parameters, spread syntax, return values, arrow function shorthand, the this trap, callbacks, and scope.

Tool TipsFrontend EngineeringAI Coding