Skip to main content

SRV Record

Stands For: Service Record

Definition: An SRV record is a type of resource record in the Domain Name System (DNS) used for service discovery. It specifies the location—both the hostname and the port number—of servers for specific services, protocols, and domains. This allows services to be moved to different hosts or ports without reconfiguring clients.

Key Characteristics:

  • Purpose: To provide a flexible way for clients to locate a service without needing the exact hostname and port number hardcoded. It enables server redundancy, load balancing, and easier service migration.
  • Name Format: The name of an SRV record has a specific structure: _service._proto.name.
    • _service: The symbolic name of the service (e.g., _sip, _ldap, _minecraft).
    • _proto: The transport protocol, typically _tcp or _udp.
    • name: The domain the record is for (e.g., example.com).
  • Data Fields: The record’s data contains four components:
    • Priority: The lowest number is considered the highest priority. Clients will attempt to connect to the server with the lowest priority value first. Used for primary/backup configurations.
    • Weight: For records with the same priority, weight determines the proportion of traffic each server receives (load balancing). A higher weight gets more traffic.
    • Port: The TCP or UDP port on which the service is running.
    • Target: The canonical hostname of the server providing the service. This hostname must have a corresponding A or AAAA record.

Example: An SRV record for _sip._tcp.example.com with data 10 60 5060 server1.example.com. means:

  • Priority: 10
  • Weight: 60
  • Port: 5060
  • Target: server1.example.com

Common Use Cases:

  • Voice over IP (VoIP): Protocols like SIP and XMPP use SRV records to locate servers.
  • Microsoft Active Directory: Used extensively to locate domain controllers, LDAP servers, and Kerberos services.
  • Minecraft: Java Edition clients use SRV records to find the specific server address and port.
  • Email Autodiscovery: Used by some email clients to automatically find server settings.

Usage Note: As of June 2025, SRV records are a crucial part of DNS for many enterprise and internet services. They provide an important layer of indirection that enhances the flexibility and resilience of service-oriented architectures.