AService record (SRV record) is a specification of data in theDomain Name System defining the location, i.e., the hostname and port number, of servers for specified services. It is defined inRFC2782, and its type code is 33. Some Internet protocols such as theSession Initiation Protocol (SIP) and theExtensible Messaging and Presence Protocol (XMPP) often require SRV support by network elements.
This points to a server namedsipserver.example.com listening on TCP port 5060 forSession Initiation Protocol (SIP) protocol services. The priority given here is 0, and the weight is 5.
As inMX records, the target in SRV records must point to hostname with an address record (A orAAAA record). Pointing to a hostname with aCNAME record is not a valid configuration.[1]
Thepriority field determines the precedence of the use of the record's data. Clients should use the SRV records with the lowest-numbered priority value first, and fall back to records of higher value if the connection fails. If a service has multiple SRV records with the same priority value, clients shouldload balance them in proportion to the values of theirweight fields. In the following example, both thepriority andweight fields are used to provide a combination of load balancing and backup service.
; _service._proto.name. TTL class SRV priority weight port target._sip._tcp.example.com.86400INSRV10605060bigbox.example.com._sip._tcp.example.com.86400INSRV10205060smallbox1.example.com._sip._tcp.example.com.86400INSRV10205060smallbox2.example.com._sip._tcp.example.com.86400INSRV2005060backupbox.example.com.
The first three records share a priority of 10, so the weight field's value will be used by clients to determine which server (host and port combination) to contact. The sum of all three weight values is 100, sobigbox.example.com will be used 60% of the time. The two hosts,smallbox1 andsmallbox2 will be used for 40% of requests total, with half of them sent tosmallbox1, and the other half tosmallbox2. Ifbigbox is unavailable, these two remaining machines will share the load equally, since they will each be selected 50% of the time.
If all three servers with priority 10 are unavailable, the record with the next lowest priority value will be chosen, which isbackupbox.example.com. This might be a machine in another physical location, presumably not vulnerable to anything that would cause the first three hosts to become unavailable.
The load balancing provided by SRV records is inherently limited since the information is essentially static. The current load of servers is not taken into account unless TTL values are low enough (around a minute or lower) that the priority (or weight) values can be quickly updated.
InMicrosoftWindows 2000 clients query for SRV records to determine thedomain controller for a given service. SRV records are also used by Outlook 2007, 2010 and Macintosh 10.6 mail to locate the Exchange Autodiscover service.[23]In Microsoft Windows networks domain controllers register their network service types forActive Directory in the DNS.
An older version of theInternet Draft forOpenPGP Web Key Directory uses SRV records for discovering OpenPGP keys through web servers.[24] Usages of SRV records are no longer part of the Internet Draft in later versions.[25]