Ask for a service, not a host
01A DNS service record maps a service and transport at a domain to named servers and ports. The application must know how its protocol uses SRV.
DNS returns service endpoint records. Target is a hostname; resolving its addresses is a later step.
Source for this drawing: RFC 2782 · Read RFC source: Applicability and SRV owner name ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
The updated Proto definition adds SHOULD registration of the global underscored protocol node. RFC 6335 separately clarifies service-name syntax and registration; these are updates to an immutable publication, not a new DNS protocol version.
Read the updated RFC section ↗The lookup name includes the symbolic service and transport, not just the original domain.
- SRV is DNS resource-record type 33. A resource record, or RR, is one DNS data item. A set of records for the queried name/type is an RRset. The owner format is _Service._Proto.Name, with class IN. Service and Proto are case insensitive (format, pages 2–3).
- The guide uses the RFC’s fictional foobar service over TCP at example.com. Its query name is _foobar._tcp.example.com. Neither foobar nor this example is a new registered service or a deployment recommendation.
- The applicability statement says the protocol specification MUST define the service’s symbolic name and include security considerations. Service SRV records SHOULD NOT be used without such a specification. Do not assume every application discovers a service through SRV.
- RFC 6335 §§5.1–5.2 updates service labels: a service name MUST be 1–15 ASCII letters/digits/hyphens, include a letter, have no leading/trailing or adjacent hyphens, and the SRV Service Label MUST prepend an underscore. The service name SHOULD be registered with IANA. Case is ignored for comparison.
- RFC 8553 §3.1 updates Proto: the global underscored protocol node, such as _tcp, SHOULD be registered in the Underscored and Globally Scoped DNS Node Names registry. It is the underscored node closest to the DNS root, not the _foobar service node.
- The SRV answer supplies target hostnames and ports. It does not directly turn the query owner into an IP address; address lookup and connection attempts follow. Underscores distinguish these service-discovery labels from ordinary host names.
Fictional service foobar; example.com documentation domain. The lookup is unicast DNS SRV, not multicast discovery or a scan of every service.
Read the RFC section ↗