16.4. Service records (SRV RRs)

Before service records (SRV RRs) are introduced an entity must know the exact address of a server to contact for a service. With the introduction of SRV RRs in [RFC2782], DNS clients can query a domain for a service or protocol and get back the names of servers. Administrators can use SRV RRs to distribute the load by using several servers to service a single domain. The DNS-type code for SRVs is 33.

The format of an SRV record is as follows (Table 16.2 describes each field in detail):

_Service._Proto.Name TTL Class SRV Priority Weight Port Target

16.4.1. SRV example

Continuing with the example, the SRV RR looks like:

Service, Proto, NameTTLClassRecord typePriorityWeightPortTarget
_sip._tcp.example.com7200INSRV015060server1.example.com
 7200INSRV035060server2.example.com

In this example the client of the SIP service in the "example.com" domain performs an SRV look-up of "_sip._tcp.example.com" followed by an A record look-up for "server2.example.com".

Table 16.2. SRV RR fields.
FieldDescription
ServiceService identifier. An underscore "_" is pre-pended
ProtoDesired protocol. An underscore "_" is pre-pended
NameThe domain of the SRV record
TTLTime to live
ClassClass of record (SRV records are of class IN, or Internet)
SRVIdentifies the entry as an SRV RR
PriorityThe priority of the target host in this record. Clients with lowest numbered priority are tried first. Weight (see below) is used if more than one record carries the same priority
WeightDenotes a relative ...

Get The IMS: IP Multimedia Concepts And Services, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.