← RFC Reference

RFC 6186: SRV Records for Email Service Autodiscovery

Current Standard DNS & Mail Routing DNS SRVAutodiscoveryIMAPMail Submission
ELI5: When you type your email address into a mail client like Thunderbird or Apple Mail, it needs to figure out which servers to connect to for sending and receiving. Instead of making you type in server names and port numbers, the client can look up special DNS records that say “the IMAP server for this domain is over here, the submission server is over there.” That is what RFC 6186 standardizes.

Why This Exists

Configuring an email client requires knowing multiple server hostnames, ports, and security settings: an IMAP or POP3 server for reading mail, and a submission server for sending. Most users cannot provide this information. Before SRV records, email clients relied on:

RFC 6186 provides a standard, DNS-based mechanism that works for any domain. The domain administrator publishes SRV records, and any compliant email client can discover the correct servers automatically.

How It Works

The email client extracts the domain from the user's email address, then queries DNS for SRV records under specific service names.

SRV Record Format

Name:     _service._proto.domain
Type:     SRV
Content:  priority weight port target

Required DNS Records

For a domain example.com with email hosted on mail.provider.net:

; Receiving mail (IMAP over TLS)
_imaps._tcp.example.com.    IN SRV  0 1 993 mail.provider.net.

; Receiving mail (IMAP with STARTTLS)
_imap._tcp.example.com.     IN SRV  0 1 143 mail.provider.net.

; Receiving mail (POP3 over TLS)
_pop3s._tcp.example.com.    IN SRV  0 1 995 mail.provider.net.

; Sending mail (Submission over TLS)
_submissions._tcp.example.com. IN SRV  0 1 465 mail.provider.net.

; Sending mail (Submission with STARTTLS)
_submission._tcp.example.com.  IN SRV  0 1 587 mail.provider.net.

Disabling a Service

To indicate that a service is not available, publish an SRV record with a target of . (a single dot):

; We do not offer POP3
_pop3._tcp.example.com.     IN SRV  0 0 0 .
_pop3s._tcp.example.com.    IN SRV  0 0 0 .

Key Technical Details

Service Names Defined by RFC 6186

SRV Name Protocol Default Port Security
_imaps._tcp IMAP 993 Implicit TLS (preferred)
_imap._tcp IMAP 143 STARTTLS
_pop3s._tcp POP3 995 Implicit TLS
_pop3._tcp POP3 110 STARTTLS
_submissions._tcp Submission 465 Implicit TLS (preferred)
_submission._tcp Submission 587 STARTTLS

Client Discovery Priority

  1. Query for _imaps._tcp first (implicit TLS is preferred over STARTTLS per RFC 8314).
  2. If no _imaps record, fall back to _imap._tcp with mandatory STARTTLS.
  3. For submission, prefer _submissions._tcp (port 465) over _submission._tcp (port 587).
  4. Use SRV priority and weight fields for load balancing and failover across multiple servers.

TLS Certificate Verification

Per RFC 7817, the client must verify the server's TLS certificate against the SRV target hostname (e.g., mail.provider.net), not the user's email domain. This allows hosting providers to serve many domains with a single certificate.

Common Mistakes

Deliverability Impact

Related RFCs