DNS – How to use SRV Records

SRV records can be the more indepth record you will ever need to add to a domain. It has many parts that need to follow strict guidlines.

This article will break down each part to allow you to create your own.

An SRV record has the following form:

_service._proto.name. TTL class 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: Sstandard DNS time to live field.
class: Standard DNS class field (this is always IN).
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 more preferred.
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:

_sip._tcp.example.com. 86400 IN SRV 0 5 5060 sipserver.example.com.

This example points to a server named sipserver.example.com listening on TCP port 5060 for Session Initiation Protocol (SIP) protocol services. The priority given here is 0, and the weight is 5.
Just like MX records, the target in SRV records must point to a hostname with an address record (A or AAAA record). Pointing to a hostname with a CNAME record is not a valid configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *

*