SRV record
   HOME

TheInfoList



OR:

A Service record (SRV record) is a specification of data in the
Domain Name System The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resources in the Internet or other Internet Protocol (IP) networks. It associates various information with domain names assigned t ...
defining the location, i.e., the hostname and port number, of servers for specified services. It is defined i
RFC 2782
and its type code is 33. Some Internet protocols such as the
Session Initiation Protocol The Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, and terminating communication sessions that include voice, video and messaging applications. SIP is used in Internet telephony, in private IP telepho ...
(SIP) and the
Extensible Messaging and Presence Protocol Extensible Messaging and Presence Protocol (XMPP, originally named Jabber) is an open communication protocol designed for instant messaging (IM), presence information, and contact list maintenance. Based on XML (Extensible Markup Language), i ...
(XMPP) often require SRV support by network elements.


Record format

A SRV record has the form: _service._proto.name. ttl IN SRV priority weight port target. * ''service'': the symbolic name of the desired service. * ''proto'': the transport protocol of the desired service; this is usually either TCP or UDP. * ''name'': the domain name for which this record is valid, ending in a dot. * ''ttl'': standard DNS
time to live Time to live (TTL) or hop limit is a mechanism which limits the lifespan or lifetime of data in a computer or network. TTL may be implemented as a counter or timestamp attached to or embedded in the data. Once the prescribed event count or time ...
field. * ''IN'': standard DNS class field (this is always ''IN''). * ''SRV'': Type of Record (this is always ''SRV''). * ''priority'': the priority of the target host, lower value means more preferred. * ''weight'': A relative weight for records with the same priority, higher value means higher chance of getting picked. * ''port'': the TCP or UDP port on which the service is to be found. * ''target'': the canonical hostname of the machine providing the service, ending in a dot. An example SRV record in textual form that might be found in a
zone file A Domain Name System (DNS) zone file is a text file that describes a DNS zone. A DNS zone is a subset, often a single domain, of the hierarchical domain name structure of the DNS. The zone file contains mappings between domain names and IP add ...
might be the following: _sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com. This points to a server named sipserver.example.com listening on TCP port 5060 for
Session Initiation Protocol The Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, and terminating communication sessions that include voice, video and messaging applications. SIP is used in Internet telephony, in private IP telepho ...
(SIP) protocol services. The priority given here is 0, and the weight is 5. As in MX records, the target in SRV records must point to hostname with an address record ( A or
AAAA record This list of DNS record types is an overview of resource records (RRs) permissible in zone files of the Domain Name System The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resour ...
). Pointing to a hostname with a CNAME record is not a valid configuration.


Provisioning for high service availability

The ''priority'' field determines the precedence of 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 should load balance them in proportion to the values of their ''weight'' fields. In the following example, both the ''priority'' and ''weight'' 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. 86400 IN SRV 10 60 5060 bigbox.example.com. _sip._tcp.example.com. 86400 IN SRV 10 20 5060 smallbox1.example.com. _sip._tcp.example.com. 86400 IN SRV 10 20 5060 smallbox2.example.com. _sip._tcp.example.com. 86400 IN SRV 20 0 5060 backupbox.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 values is 100, so bigbox.example.com will be used 60% of the time. The two hosts, smallbox1 and smallbox2 will be used for 40% of requests total, with half of them sent to smallbox1, and the other half to smallbox2. If bigbox 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 is backupbox.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. 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.


Usage

SRV records are common in conjunction with the following
standardized Standardization or standardisation is the process of implementing and developing technical standards based on the consensus of different parties that include firms, users, interest groups, standards organizations and governments. Standardization ...
communications protocol A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any kind of variation of a physical quantity. The protocol defines the rules, syntax, semantics and synch ...
s: *
APT Apt. is an abbreviation for apartment. Apt may also refer to: Places * Apt Cathedral, a former cathedral, and national monument of France, in the town of Apt in Provence * Apt, Vaucluse, a commune of the Vaucluse département of France * A ...
*
CalDAV Calendaring Extensions to WebDAV, or CalDAV, is an Internet standard allowing a client to access and manage calendar data along with the ability to schedule meetings with users on the same or on remote servers. It lets multiple users in diff ...
and
CardDAV vCard Extensions to WebDAV (CardDAV) is an address book client/server protocol designed to allow users to access and share contact data on a server. The CardDAV protocol was developed by the IETF and was published as in August 2011. CardDAV is ...
* Ceph * DANE * DNS Service Discovery (DNS-SD) * Factorio *
Host Identity Protocol The Host Identity Protocol (HIP) is a host identification technology for use on Internet Protocol (IP) networks, such as the Internet. The Internet has two main name spaces, IP addresses and the Domain Name System. HIP separates the end-point i ...
* Kerberos *
LDAP The Lightweight Directory Access Protocol (LDAP ) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory servi ...
*
SMTP The Simple Mail Transfer Protocol (SMTP) is an Internet standard communication protocol for electronic mail transmission. Mail servers and other message transfer agents use SMTP to send and receive mail messages. User-level email clients ty ...
submission Deference (also called submission or passivity) is the condition of submitting to the espoused, legitimate influence of one's superior or superiors. Deference implies a yielding or submitting to the judgment of a recognized superior, out of re ...
,
POP Pop or POP may refer to: Arts, entertainment, and media Music * Pop music, a musical genre Artists * POP, a Japanese idol group now known as Gang Parade * Pop!, a UK pop group * Pop! featuring Angie Hart, an Australian band Albums * ''Pop'' ( ...
, and
IMAP In computing, the Internet Message Access Protocol (IMAP) is an Internet standard protocol used by email clients to retrieve email messages from a mail server over a TCP/IP connection. IMAP is defined by . IMAP was designed with the goal of per ...
* Matrix.org * ''
Minecraft ''Minecraft'' is a sandbox game developed by Mojang Studios. The game was created by Markus "Notch" Persson in the Java programming language. Following several early private testing versions, it was first made public in May 2009 before b ...
'' *
MongoDB MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the S ...
* Mumble *
IMPS IMPS or Imps may refer to: * ''Imps*'', a comedy film released in 2009 * OMA Instant Messaging and Presence Service * Infinite Monkey Protocol Suite, an April Fools' Day RFC * The Oxford Imps, an improvisational comedy troupe * Insensitive muni ...
*
Puppet A puppet is an object, often resembling a human, animal or mythical figure, that is animated or manipulated by a person called a puppeteer. The puppeteer uses movements of their hands, arms, or control devices such as rods or strings to move ...
*
Session Initiation Protocol The Session Initiation Protocol (SIP) is a signaling protocol used for initiating, maintaining, and terminating communication sessions that include voice, video and messaging applications. SIP is used in Internet telephony, in private IP telepho ...
* STUN * Teamspeak 3 *
XMPP Extensible Messaging and Presence Protocol (XMPP, originally named Jabber) is an open communication protocol designed for instant messaging (IM), presence information, and contact list maintenance. Based on XML (Extensible Markup Language), i ...
In
Microsoft Microsoft Corporation is an American multinational technology corporation producing computer software, consumer electronics, personal computers, and related services headquartered at the Microsoft Redmond campus located in Redmond, Washi ...
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft and oriented towards businesses. It was the direct successor to Windows NT 4.0, and was released to manufacturing on December 15, 1999, and was offici ...
clients query for SRV records to determine the
domain controller A domain controller (DC) is a server computer that responds to security authentication requests within a computer network domain. It is a network server that is responsible for allowing host access to domain resources. It authenticates users, stores ...
for a given service. SRV records are also used by Outlook 2007, 2010 and Macintosh 10.6 mail to locate the Exchange Autodiscover service. In Microsoft Windows networks domain controllers register their network service types for
Active Directory Active Directory (AD) is a directory service developed by Microsoft for Windows domain networks. It is included in most Windows Server operating systems as a set of processes and services. Initially, Active Directory was used only for centralize ...
in the DNS. An older version of the
Internet Draft An Internet Draft (I-D) is a document published by the Internet Engineering Task Force (IETF) containing preliminary technical specifications, results of networking-related research, or other technical information. Often, Internet Drafts are int ...
for
OpenPGP Pretty Good Privacy (PGP) is an encryption program that provides cryptographic privacy and authentication for data communication. PGP is used for signing, encrypting, and decrypting texts, e-mails, files, directories, and whole disk partiti ...
Web Key Directory uses SRV records for discovering OpenPGP keys through web servers. Usages of SRV records are no longer part of the Internet Draft in later versions. A registry of service names for SRV records & protocols is maintained by the
Internet Assigned Numbers Authority The Internet Assigned Numbers Authority (IANA) is a standards organization that oversees global IP address allocation, autonomous system number allocation, root zone management in the Domain Name System (DNS), media types, and other Inte ...
(IANA) as defined in RFC 6335.


See also

*
List of DNS record types This list of DNS record types is an overview of resource records (RRs) permissible in zone files of the Domain Name System The Domain Name System (DNS) is a hierarchical and distributed naming system for computers, services, and other resou ...
* MX record — a DNS RR type used for locating the SMTP server


References


External links


RFC 2782 – Definition of the SRV resource record
-
RFC 6186 – Use of SRV Records for Locating Email Submission/Access Services
-
Using DNS SRV records to locate whois servers (Internet-Draft)
-
Use of SRV records in conjunction with HTTP and URIs (Internet-Draft)
-
Service Name and Transport Protocol Port Number Registry
- {{webarchive , url=https://web.archive.org/web/20200706003543/https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml , date=6 July 2020 DNS record types