isitdns? wiki/Records/SRV: service location
Records

SRV: service location

*Find the host and* port for a named service.** SRV records let a client discover where a service like _xmpp-server._tcp.example.com lives, without hard-coding a hostname or port.

In one line:

_xmpp-server._tcp.example.com.    SRV    10 5 5269 xmpp.example.com.
└── service.protocol.domain ──┘   └type┘ └── priority weight PORT target
Type number33
RFC2782
RDATApriority · weight · port · target FQDN

What it holds#

FieldPurpose
PriorityLower wins: clients try the record with the lowest priority value first, which is the highest priority. (Same idea as MX preference.)
WeightWithin one priority level, weighted random distribution. Higher weight = more traffic.
PortTCP/UDP port the service listens on.
TargetA hostname (A/AAAA: NOT a CNAME, the same rule as MX).
_ldap._tcp.example.com.       SRV   10 0  389 ldap.example.com.
_kerberos._udp.example.com.   SRV    0 0   88 kdc.example.com.

When to use it#

  • Whenever the service has a registered SRV form: XMPP, SIP, LDAP, Kerberos, autodiscover, Matrix federation.
  • For service discovery without a load balancer: clients query SRV and get a weighted list of backends.
  • For in-house services where you want the name decoupled from a fixed hostname and port.

When not to use it#

  • For HTTP/HTTPS: those use HTTPS/SVCB instead. Browsers do not query SRV for web traffic.
  • For a service with no client support for SRV: a record nothing reads is dead weight.

dig example#

Asks where the XMPP server for example.isitdns.net lives.

 dig @1.1.1.1 _xmpp-server._tcp.example.isitdns.net SRV
; <<>> DiG 9.20.11-0ubuntu0.2-Ubuntu <<>> @1.1.1.1 _xmpp-server._tcp.example.isitdns.net SRV
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 47750
;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;_xmpp-server._tcp.example.isitdns.net. IN SRV
;; ANSWER SECTION:
_xmpp-server._tcp.example.isitdns.net. 300 IN SRV 10 5 5269 example.com.
;; Query time: 40 msec
;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP)
;; WHEN: Mon Sep 14 13:45:34 CDT 2026
;; MSG SIZE rcvd: 97

GO NOERROR and one SRV with priority, weight, port and target

NO GO NOERROR with no answer, which means the service is not published here

what each part of this output means →

RFC: RFC 2782 defines the _service._proto.name form, the four RDATA fields, and the priority-then-weight selection algorithm clients run over the answer.

DoH query (HTTPS)#

DoH is DNS-over-HTTPS (RFC 8484); the JSON form below is a Cloudflare/Google extension, not part of the RFC itself:

curl -s -H 'accept: application/dns-json' \
  'https://cloudflare-dns.com/dns-query?name=_xmpp-server._tcp.example.isitdns.net&type=SRV' \
  | jq .Answer
[
  {
    "name": "_xmpp-server._tcp.example.isitdns.net",
    "type": 33,
    "TTL": 300,
    "data": "10 5 5269 example.com"
  }
]

"AD": true in the full response (not shown by jq .Answer) means the resolver validated the DNSSEC chain for this answer (RFC 4035 §3.2.3).

Gotchas#

  • Target must not be an alias. RFC 2782 requires the target to have its own address record and forbids it being an alias, so it cannot be a CNAME.
  • Service and proto labels start with underscore. _ldap, not ldap. _tcp, not tcp. Miss it and discovery silently fails.
  • A target of . means no service. RFC 2782 defines a target of . (the root) as "the service is decidedly not available at this domain," the SRV equivalent of null MX.
  • Weight 0 is the documented way to say "no preference." RFC 2782 recommends weight 0 when there is nothing to load-balance; among records with weight greater than 0, a weight-0 record still gets only a small chance of being picked.
  • DANE over SRV is protocol-specific. RFC 7673 lets protocols that use SRV hang a TLSA record off the SRV target (its examples are IMAP and XMPP). SMTP does not use SRV, so its DANE profile (RFC 7672) hangs off the MX target instead. The _xmpp-server._tcp.example.isitdns.net demo record above is signed and validates.

See also#