Skip to main content
All CollectionsDNS Records
The Role of SRV Records in Email & How to Configure Them Correctly
The Role of SRV Records in Email & How to Configure Them Correctly

Learn how SRV records enhance email security, enable service discovery, and optimize mail server configurations with step-by-step setup and troubleshooting.

Updated over 3 weeks ago

When configuring email security and ensuring seamless communication, understanding DNS records is crucial. One such important but often overlooked record is the SRV (Service) record. While SRV records are commonly associated with VoIP and instant messaging, they also play a vital role in certain email configurations, especially in environments that rely on specific mail services. In this article, we'll break down what SRV records are, their function in email systems, and how to configure them properly to enhance email security and deliverability.


What is an SRV Record? 🛠️

An SRV (Service) record is a DNS record that specifies the location of a service, including the hostname and port number. Unlike traditional DNS records (A, MX, TXT), SRV records allow for more advanced service discovery, which is useful in dynamically assigning mail services.

Key Components of an SRV Record:

An SRV record consists of the following fields:

  • Service: Defines the service being used (_submission, _smtp, _autodiscover, etc.)

  • Protocol: Specifies TCP or UDP (_tcp, _udp)

  • Priority: Lower values indicate higher priority

  • Weight: Used for load balancing (higher value gets more traffic)

  • Port: Defines the service port (e.g., 587 for SMTP submission)

  • Target: Specifies the hostname providing the service

Example of an SRV Record:

_submission._tcp.example.com. 3600 IN SRV 10 5 587 mail.example.com.
  • _submission._tcp → Defines an SMTP Submission service over TCP

  • 10 → Priority (lower means higher preference)

  • 5 → Weight (used when multiple SRV records exist for load balancing)

  • 587 → Port (common SMTP submission port)

  • mail.example.com. → The mail server handling the service


The Role of SRV Records in Email 📧

1. Email Service Discovery

  • Some email clients and services use SRV records to automatically detect mail server settings, reducing the need for manual configuration.

2. Load Balancing & Failover

  • SRV records help distribute email traffic across multiple servers and ensure failover by prioritizing secondary servers when the primary one is down.

3. Enhanced Security with Secure Submission

  • They ensure email clients use the correct and secure ports, reducing misconfigurations that could lead to security vulnerabilities.

4. Integration with Cloud Email Providers

  • Some cloud-based email services rely on SRV records to guide mail clients toward the correct outbound SMTP servers.


Configuring SRV Records Correctly 🛠️

Step 1: Identify Your Email Provider’s Requirements

Before creating an SRV record, check your email service provider’s documentation for the exact values to use (priority, weight, port, and target).

Step 2: Add the SRV Record to Your DNS

If you are using cPanel, Cloudflare, or a registrar's DNS manager, navigate to the DNS settings and add an SRV record.

Example SRV Record for an SMTP Submission Service

Service: _submission Protocol: _tcp Priority: 10 Weight: 5 Port: 587 Target: mail.example.com. TTL: 3600

In BIND (DNS Zone File Format):

_submission._tcp.example.com. 3600 IN SRV 10 5 587 mail.example.com.

In PowerShell for Microsoft DNS:

Add-DnsServerResourceRecordSRV -Name "_submission._tcp" -ZoneName "example.com" -DomainName "mail.example.com" -Priority 10 -Weight 5 -Port 587 -TimeToLive 3600

Step 3: Verify Your SRV Record

Use the following command to check if your SRV record is correctly configured:

dig _submission._tcp.example.com SRV +short

Or, using nslookup:

nslookup -type=SRV _submission._tcp.example.com

Step 4: Test Email Connectivity

Once the SRV record is live, test sending and receiving emails using an email client that supports SRV-based discovery. You can also monitor email logs for authentication issues or misconfigurations.


Common Issues & Troubleshooting 🔍

1. SRV Record Not Resolving

  • Ensure the record is correctly added to the DNS.

  • Wait for DNS propagation (can take up to 24 hours).

  • Verify using dig or nslookup.

2. Email Clients Not Detecting SRV Records

  • Some email clients may not support SRV records for email services.

  • Ensure you have configured the SRV record in the correct domain and subdomain format.

3. Incorrect Priority & Weight Configuration

  • If using multiple servers, adjust the weight values to ensure proper load balancing.


Final Words🎯

SRV records are an essential yet underutilized component in email configuration. Whether used for auto-discovery, secure SMTP submission, or load balancing, correctly configuring SRV records can enhance email security and performance. By implementing and testing SRV records, you ensure that email clients and services seamlessly connect to the right servers, reducing misconfigurations and improving email reliability. Always verify your records and monitor DNS logs for any unexpected issues. ✅

Did this answer your question?