Skip to content

SRV record: Definition, Use Cases, and Examples

TL;DR:

SRV (Service) is a DNS record that specifies hostname and port for a service. Used by XMPP, SIP, Minecraft, Kerberos, LDAP. Format: _service._proto.name TTL IN SRV priority weight port target. Example: _sip._tls.example.com. 3600 IN SRV 10 60 5061 sipserver.example.com.

Check your domain's DNS →

What is SRV record

SRV (Service) is a DNS record that specifies hostname and port for a service. Used by XMPP, SIP, Minecraft, Kerberos, LDAP. Format: _service._proto.name TTL IN SRV priority weight port target. Example: _sip._tls.example.com. 3600 IN SRV 10 60 5061 sipserver.example.com.

Check SRV record online

Open tool →

Understanding the Structure of an SRV Record

An SRV (Service) DNS record is essential for directing traffic to specific services running on a domain. Its structure is defined by several components, each serving a distinct purpose. The format is as follows:

_service._proto.name TTL IN SRV priority weight port target

Here's a breakdown of each component:

  • _service: This indicates the specific service you are using, such as _sip for SIP services or _xmpp for XMPP.
  • _proto: This signifies the transport protocol used, typically _tcp or _udp.
  • name: The domain name where the service is hosted, often ending with a domain extension (e.g., example.com).
  • TTL: Time to Live, which specifies how long the record is cached by DNS resolvers.
  • priority: A lower number indicates higher priority. This is used when multiple SRV records exist for the same service.
  • weight: Used to distribute load between multiple servers with the same priority. Higher weights receive more traffic.
  • port: The port number on which the service is running (e.g., 5061).
  • target: The hostname of the server providing the service.

Understanding this structure is critical for configuring services that rely on DNS SRV records, ensuring that your applications can locate and connect to the appropriate servers.

How to Check SRV Records Using Command Line Tools

Checking SRV records can be accomplished using various command line tools, such as dig and nslookup. Below are examples of how to utilize these tools to verify SRV records for a specific service:

Using dig

The dig command provides detailed information about DNS records. To check an SRV record, use the following syntax:

dig _service._proto.name SRV

For example, to check the SRV record for a SIP service on example.com, you would run:

dig _sip._tcp.example.com SRV

This command will return the SRV record details, including priority, weight, port, and target hostname.

Using nslookup

The nslookup command can also be used to query SRV records. The syntax is slightly different:

nslookup -type=SRV _service._proto.name

For instance, to check the same SIP service, you would execute:

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

Both commands will provide you with the necessary information to confirm the existence and correctness of your SRV records, helping diagnose any potential connectivity issues.

Common Use Cases for SRV Records

SRV records are utilized across various applications and services to facilitate efficient service discovery. Here are some common use cases:

  • VoIP Services: SRV records play a crucial role in Voice over IP (VoIP) applications like SIP. They help clients discover the correct server and port for making calls.
  • Instant Messaging: Services such as XMPP (Jabber) use SRV records to locate chat servers, ensuring that messages are routed correctly.
  • Gaming: Multiplayer games like Minecraft utilize SRV records to direct players to game servers. This allows for easier connection without needing to specify ports manually.
  • Enterprise Applications: Applications using Kerberos for authentication often rely on SRV records to find the Key Distribution Center (KDC) for secure ticket granting.
  • LDAP Services: Lightweight Directory Access Protocol (LDAP) services use SRV records to locate directory servers, optimizing access to user information.

In each of these cases, SRV records streamline the connection process, allowing clients to locate services dynamically without hardcoding server details. This flexibility is particularly beneficial in environments where services may change frequently.

A / AAAAIPv4 and IPv6 host addresses
MX RecordsDomain mail servers
TXT / SPFVerification & anti-spoofing
NS / SOAName servers & zone authority

Why teams trust us

12
DNS record types
SPF+DKIM
email protection
<1s
DNS response
3
check regions

How it works

1

Enter domain

2

Select record type

3

Get DNS response

What are DNS Records?

DNS (Domain Name System) translates domain names into IP addresses. DNS records are instructions that define where to route traffic, email, and how to verify domainownership.

Complete Lookup

Query all record types — A, AAAA, MX, NS, TXT, CNAME, SOA — in a single request.

Instant Results

Direct queries to authoritative servers. Results in milliseconds, no caching.

Security Checks

SPF, DKIM, and DMARC analysis to evaluate email protection against spoofing and phishing.

Export & History

Save check results. Compare DNS records before and after registrar changes.

Who uses this

DevOps

DNS check after deploy

Email marketers

SPF/DKIM/DMARC audit

SEO

DNS config audit

Sysadmins

DNS zone control

Common Mistakes

Missing SPF recordWithout SPF, emails may land in spam. Add a v=spf1 TXT record.
Single NS serverIf the only NS fails, the domain becomes unreachable. Use at least 2 NS servers.
CNAME conflicting with other recordsCNAME cannot coexist with MX or TXT on the same name — this violates RFC.
TTL set too highWith 86400s TTL, DNS changes take a full day. Lower TTL to 300 before migrations.
Missing PTR recordMail servers check PTR. Without it, emails may be rejected.

Best Practices

Set up SPF + DKIM + DMARCThe trio of records that protects your email from spoofing and improves deliverability.
Use 2+ NS serversDistribute NS servers across different networks for redundancy.
Lower TTL before migrationSet TTL to 300 at least 24-48 hours before an IP change for fast propagation.
Verify DNS after changesAfter updating records, confirm changes propagated correctly and no errors remain.
Add a CAA recordCAA restricts which Certificate Authorities can issue SSL certificates for your domain.

Get more with a free account

DNS check history, API keys and DNS change monitoring.

Sign up free

Learn more

Frequently Asked Questions

Do I need SRV record?

See the use-case section above. For a quick check, use our online form.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.