How to set up email on your own domain
An address on a domain you own takes a few DNS records and an afternoon. Here is each one, in the order you need it, and how to tell it is working.
An address on your own domain — you@yourname.com instead of yourname1987@gmail.com — is one of the cheapest upgrades there is. It looks more trustworthy to the people you write to, it survives a change of provider, and nobody can take the name away from you as long as you renew the domain.
Setting it up is mostly DNS: a handful of records that tell the rest of the internet where your mail lives and which servers may send it. This guide goes through them in the order you need them, what each one does, and how to tell when it is working.
1. Own the domain
Buy the domain from any registrar. It does not have to be the company that hosts your mail, and it is better if it is not: the registrar holds the name, the mail provider holds the mailboxes, and keeping them apart is what makes moving later a DNS change rather than a migration.
Whoever manages the domain's DNS — usually the registrar, sometimes Cloudflare or your web host — is where every record below gets added.
2. Point MX at your mail provider
The MX record says which servers accept mail for your domain. When somebody writes to you@yourname.com, their server looks up your MX records and delivers to the host they name, trying the lowest priority number first.
Your provider gives you the host names. Remove any MX records left over from a previous provider or a registrar's parking page: two sets of MX records means some mail goes to the old place, and nothing tells you it did.
3. Publish SPF, DKIM and DMARC
MX gets mail in. These three are about mail going out — they are how a receiving provider decides that a message claiming to be from your domain really is, and they are much of the difference between the inbox and the spam folder.
- SPF is one TXT record on the domain itself, starting v=spf1, listing the servers allowed to send as you. Only one SPF record is allowed; a second one breaks both.
- DKIM is a TXT record under a selector, like selector._domainkey.yourname.com, holding a public key. Your provider signs each outgoing message with the matching private key, and receivers check the signature against it.
- DMARC is a TXT record at _dmarc.yourname.com that ties the two together and tells receivers what to do with mail that fails: nothing (p=none), the spam folder (p=quarantine) or refuse it (p=reject).
4. Wait for DNS, then check
New records are usually visible within minutes, but a resolver that cached the old answer keeps it until its TTL runs out — up to a day or two on records that were set with a long one. If something looks wrong straight after a change, it is often only old.
Check that each record resolves to exactly what your provider gave you, then send a message to a Gmail or Outlook address and open its original headers. You are looking for spf=pass, dkim=pass and dmarc=pass. All three passing is the setup done.
5. Bring your old mail with you
A new domain does not have to mean an empty inbox. Most providers can import an existing mailbox over IMAP, and forwarding from the old address catches the people who have not updated your details yet. Keep the old account open for a few months, and change the address on the logins that matter first — your bank, your registrar, your password manager.
Or let the provider do the DNS
Every step above is something a mail provider can check for you instead of leaving you with a page of instructions. On Ruber you add the domain and we write and verify the MX, SPF, DKIM and DMARC records — connect Cloudflare and authorise it once, or take the records and add them by hand, and the domain page shows which ones are correct until all of them are.