What is a DNS SRV record?
There are several types of records - or Resource Records as they are called - in the Domain Name System (DNS). This page explains what the SRV record is and how it's used.
The purpose of a DNS SRV record #
SRV stands for "service". The SRV records can be useful to help services auto-discover configuration or connection settings.
For example, a well-configured SRV record can help mailserver auto-determine the settings for POP3 or IMAP mailservers. Or it can help telephones determine the SIP details to connect to the voice-over-IP server.
The structure of a DNS SRV record #
The SRV records contain a fairly complex structure, here's an example:
_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.
There's several flags that can be provided to a SRV record:
<service>.<proto>.<host> <TTL> IN SRV <priority> <weight> <port> <target>
The first portion, everything before the TTL, is unique in this record that it also contains meta information about the service you're describing.