Skip to content

Autodiscover and autoconfig on Cloudflare: the records that make Outlook and Thunderbird configure themselves

Outlook and Thunderbird find mail settings through autodiscover and autoconfig DNS entries. Which records to create on Cloudflare for Microsoft 365 and self-hosted mail, and why they stay DNS-only.

When a user types their address into Outlook or Thunderbird and the client fills in the servers by itself, DNS did the work: Outlook looked for autodiscover.example.com (and an SRV fallback), Thunderbird looked for autoconfig.example.com. On Cloudflare these are ordinary records with one rule attached — keep them DNS-only. A proxied autodiscover CNAME puts Cloudflare’s edge between the mail client and the provider’s configuration endpoint, and the TLS name and response the client expects stop matching. The records take five minutes; the payoff is that “set up my email on the new laptop” tickets stop existing.

What’s happening

Outlook’s autodiscover walks a fixed candidate list: an HTTPS endpoint on the root domain, then https://autodiscover.example.com/autodiscover/autodiscover.xml, then the SRV record _autodiscover._tcp.example.com, and for Microsoft 365 accounts, Microsoft’s own directory. Each candidate is an HTTPS POST that must return a specific XML payload under a certificate valid for the name being contacted. That certificate detail is why the proxy hurts: with the orange cloud on, the client negotiates TLS with Cloudflare, and what sits behind the proxy (Microsoft’s endpoint or your mail server’s autodiscover handler) is no longer presenting its own expected identity end to end — setups fail with certificate warnings or generic “cannot find settings” errors that look nothing like a DNS problem.

Thunderbird is simpler: it fetches http://autoconfig.example.com/mail/config-v1.1.xml (HTTPS first where available), falls back to Mozilla’s public ISP database, then guesses common hostnames. cPanel, Plesk, mailcow, and most self-hosted stacks serve both the autodiscover and autoconfig endpoints for you — your only job on the Cloudflare side is pointing the names at the box, grey-clouded so the client talks straight to the server that holds the right certificate.

What to check first

  • Where mailboxes actually live. Microsoft 365 wants a CNAME to Microsoft; a self-hosted server wants the names pointed at itself.
  • Whether the names already exist. The migration scan misses autodiscover and autoconfig constantly — after a DNS move they are the classic silent casualties.
  • Proxy status. Both hostnames grey. The SRV record has no proxy option, which is one less thing to break.
  • Whether the server actually serves the endpoints. cPanel and friends do by default; a hand-built Postfix/Dovecot box does not unless you added something.

How to verify

# The records, from a neutral resolver
dig @1.1.1.1 +short CNAME autodiscover.example.com
dig @1.1.1.1 +short A autodiscover.example.com
dig @1.1.1.1 +short SRV _autodiscover._tcp.example.com
dig @1.1.1.1 +short A autoconfig.example.com

# The endpoints themselves
curl -s -o /dev/null -w '%{http_code}\n' https://autodiscover.example.com/autodiscover/autodiscover.xml
curl -s http://autoconfig.example.com/mail/config-v1.1.xml?emailaddress=user@example.com | head -20

Autodiscover answers a bare GET with 405 or an error document on many servers — that still proves TLS and routing work; the client sends a POST. For the mail servers the XML will hand out, confirm they answer:

openssl s_client -connect mail.example.com:993 -brief
openssl s_client -connect mail.example.com:25 -starttls smtp -brief

The fix

  1. Microsoft 365 tenants: one CNAME, DNS-only:

    autodiscover.example.com  CNAME  autodiscover.outlook.com

    Modern Outlook finds Microsoft 365 through its own service even without this, but older Outlook builds and other Exchange-protocol clients still walk DNS — publish it.

  2. Self-hosted mail (cPanel, Plesk, mailcow, Exchange on-prem): point both helper names at the mail host and add the SRV fallback:

    autodiscover.example.com  A    203.0.113.25
    autoconfig.example.com    A    203.0.113.25
    _autodiscover._tcp.example.com  SRV  0 0 443 mail.example.com

    In Cloudflare’s SRV editor that is service _autodiscover, protocol TCP, priority 0, weight 0, port 443, target mail.example.com.

  3. Keep every one of them DNS-only. These names exist for mail clients, not for the web audience the proxy serves.

  4. Confirm the certificate covers the names the clients will contact — autodiscover.example.com on a self-hosted box needs to be in the server’s certificate (cPanel’s AutoSSL includes it by default when DNS resolves to the box).

  5. Test with a real client: delete and re-add an account in Thunderbird and in Outlook. Autoconfigured settings appearing without prompts is the pass condition.

When this fix is wrong

If clients configure fine but then fail to connect, the discovery layer already works — the problem is the IMAP/SMTP hostnames the XML hands out, their certificates, or the proxy status of those records; see the mail subdomain strategy. And if users are on Microsoft 365 with modern Outlook only, absence of these records is rarely the real blocker — check credentials and licensing before touching DNS.

Common mistakes

  • Proxying autodiscover because the dashboard’s default for new CNAMEs was left on orange.
  • Creating autodiscover for Microsoft 365 while the MX still points at the old self-hosted server — discovery then contradicts delivery.
  • Forgetting these names during a DNS migration, then spending a day on “new laptops cannot set up email” without connecting it to the move.
  • Serving autoconfig XML that references hostnames whose certificates do not match, so Thunderbird configures and then throws security warnings.
  • Testing autodiscover with a GET, seeing an error page, and “fixing” a working setup.

Prevention

Put autodiscover, autoconfig, and the SRV record on the same migration checklist as MX and the TXT trio — they are the records the onboarding scan will not find, as covered in the migration-day triage runbook. Cloudflare’s DNS documentation covers SRV field mapping if the editor’s split fields are unfamiliar.

Mail that breaks after a DNS move is one of the most common incidents we untangle — Stack Harbor manages the full DNS and mail path under Managed Cloud Ops; book an infrastructure review before the next migration.