SRV record
An SRV record (service record) is a DNS entry that, for a specific network service, names both the host and the port number the service runs on. It goes beyond what an A record can do — which returns only an IP address — and lets you direct different services of the same domain to different servers and ports.
How an SRV record works
An SRV record's name has a fixed form: _service._protocol.domain, e.g. _sip._tcp.example.com. Its value contains four fields:
- priority — the priority; a lower value is chosen first,
- weight — the weight for spreading traffic among hosts of the same priority,
- port — the port number the service listens on,
- target — the host name, resolved further via an A/AAAA record.
The mechanism thus combines failover resilience (priority) with simple load balancing (weight), bringing the SRV record's function close to what the MX record does for mail, but for any service.
The SRV record in practice
SRV records are used by protocols and services that must discover their server within a domain on their own: SIP telephony and VoIP, XMPP messaging, directory services in Microsoft environments (Active Directory), and some games and self-hosted apps. Instead of manually entering an address and port in the client configuration, you provide just the domain — the client queries DNS for the right SRV record and learns where and to which port to connect.
Powiązane pojęcia
Najczęstsze pytania
How does an SRV record differ from an A record?
An A record only provides a host's IP address, while an SRV record names the host together with a specific service port and priority and weight parameters. This means the client does not have to assume a default port — it receives the full endpoint to connect to from DNS.
