← All guides

Buy a domain and get email on it

Buy yourname.com, point it at your site with HTTPS, and send and receive email as hello@yourname.com without landing in spam.

Time: 1 hour, plus up to a day for DNS · Cost: About $10–20 a year for a .com; email from free (forwarding) to a few dollars a month per mailbox

Get this guide as a skill for Claude Code, Cursor or any AI coding agent.Get the skill

Use your AI as the copilot

Open your coding agent in the project folder and give it this job. Let it inspect files, run safe checks and prepare the work; you stay in control of accounts, payments, secrets and the final publish button.

Help me connect a domain and email to this project. Inspect the repository and identify the current hosting provider, production URL, email-related code and any existing domain assumptions. Do not buy anything, sign in to accounts or change DNS. Give me a provider-neutral checklist and tell me exactly what I must verify manually.

1. Choose the name

Short, easy to say out loud, no hyphens. Prefer .com, or a country ending if your customers are local. Let the AI generate candidates and catch confusing spellings, then verify availability and trademarks yourself.

Ask your AI:

Suggest 20 short domain names for this product based on its README and audience. Avoid hyphens and hard-to-spell words. Group them by naming idea and flag possible confusion; do not claim any name is available.

2. Buy it at a registrar

Cloudflare Registrar sells at cost with no markup; Namecheap and Porkbun are popular too. Compare the renewal price, not the first-year price. Turn on auto-renew, WHOIS privacy (usually free) and two-factor sign-in on the registrar account: whoever holds this login owns your domain. One catch: a domain bought at Cloudflare must keep Cloudflare as its DNS, so in the next step you add records there instead of switching nameservers.

3. Point it at your site

In your host (Vercel: Project → Settings → Domains) add yourname.com and www.yourname.com. It shows the exact DNS records to create at your registrar. (If your DNS is on Cloudflare, set those records to "DNS only" / grey cloud while your host verifies the domain and issues its certificate.) Give the AI the record names and types (never your account login) and ask it to sanity-check them before you save. HTTPS is issued once DNS is live.

Ask your AI:

Review this proposed DNS record list for conflicts, duplicate records and common mistakes. Explain what each record does. Do not invent missing values; mark anything I must copy from my host.

4. Decide what kind of email you need

Only receiving? Free forwarding (Cloudflare Email Routing, which needs your DNS on Cloudflare, or your registrar's forwarding) sends hello@yourname.com to your existing Gmail. Need real mailboxes that send too? Google Workspace or Zoho Mail. Pick one provider: a domain should have one set of MX records.

5. Verify the domain and add the MX records

The email provider gives you a TXT record to prove you own the domain and MX records that route incoming mail to it. Add them exactly as shown at whoever runs your DNS, then press verify in the provider.

6. Add SPF, DKIM and DMARC so you do not land in spam

SPF lists who may send for your domain (exactly one SPF record, merge if you have two). DKIM is a signature key your provider generates. DMARC tells receivers what to do with failures; start with monitoring only. Ask the AI to review records, but copy the exact provider values yourself.

Ask your AI:

Check these SPF, DKIM and DMARC records for syntax errors and duplicates. Explain any change. Do not replace provider-specific values with guesses.
TXT  @        v=spf1 include:_spf.google.com ~all      (Google example)
TXT  google._domainkey   v=DKIM1; k=rsa; p=…  (copy from the admin console)
TXT  _dmarc   v=DMARC1; p=none; rua=mailto:you@yourname.com

7. Test it

If you set up a full mailbox or an app sending service, send a message to a Gmail address, open it, choose Show original, and look for SPF: PASS, DKIM: PASS and DMARC: PASS. mail-tester.com gives a score and tells what is missing. If you only set up free forwarding, send an email from another address to hello@yourname.com and confirm it lands in your inbox.

8. Email from your app is separate

Password resets and receipts sent by your app should go through a sending service (Resend, Postmark) on a subdomain like mail.yourname.com, with its own SPF and DKIM records. That keeps a bulk-sending problem from hurting your personal mailbox.

Official pages

Prices and rules change. When this guide and the provider disagree, the provider is right.

Learn to build the thing you are publishing: see the courses →

Buy a domain and get email on it: a step-by-step guide · Vibe to Dev