What is an SRV Record?
SRV (Service) records are custom DNS records. They are used to establish connections between a service and a hostname. When an application needs to find the location of a specific service, it will search for a related SRV record. If it finds one, it will sift through the list of services and their connecting hostnames to find the following:
Creating an SRV record can potentially save you time later on.
For example, a compatible new email client will pull your ports and settings preferences from the SRV record if you have one configured. Without the SRV record, a new email client will guess (usually incorrectly) these preferences.
The SRV Structure
This section will walk you through the different parts of the SRV record.
Each SRV record begins with an underscore ( _ ). This lets the SRV record know where each line starts.
The underscore is followed by the service name. Server services have symbolic names that are used in SRV records, like FTP (File Transfer Protocol) or IMAPS (Internet Message Access Protocol). This is the service you are publishing information for. For example, IMAPS would be an email service.
The Internet Assigned Numbers Authority (IANA) maintains a list of services and their symbolic names. Visit their list here.
After the service, a period ( . ) and an underscore ( _ ) are added to signify that the service has been established and the next section is beginning.
Protocol is listed next. This is usually TCP or UDP, two common transportation protocols.
If you would like more information about TCP and UDP, check out this article.
Next, the service's domain name is listed.
A period is added at the end of the domain name to signify where it ends.
The priority number is added next. SRV records often list multiple services, so to establish which services should be looked at first, each line is given a priority number. The lower the number value, the earlier the SRV record will look at it.
For example, in the lines below, the first line has a priority of 10, while the second has a priority of 20. The line with the priority of 10 would be viewed first. The line with the priority of 20 would be viewed second.
_imaps._tcp.mydomain.com 10 1 993 username1.mail.pairserver.com _imaps._tcp.mydomain.com 20 1 993 username2.mail.pairserver.com
If two or more services have the same priority, the weight number is used to determine which line should come first. The higher the number, the earlier the SRV record will look at it.
In the example below, the priorities are the same, but the weights differ. In this case, the line with the weight of 20 would be viewed first.
_imaps._tcp.mydomain.com SRV 20 10 993 username1.mail.pairserver.com _imaps._tcp.mydomain.com SRV 20 20 993 username2.mail.pairserver.com
The port number is optional. It is usually only included in lines related to email.
Common port numbers are:
- 993 (IMAPS)
- 995 (POPS)
- 587 (SMTPS)
This is the name of the host provides the service.
A period ( . ) is used to signal the end of the target.
If a hostname is absent, the service provider defaults to internal.
If the hostname is replaced by a period ( . ), the service will be blocked.
- Log into the Account Control Center (ACC)
- Click Domains in the left sidebar
- Click Manage Your Domain Names
- Click the name of the domain name you would like to work on
- Click Manage Custom DNS Records
- Click Add New Custom DNS Records
- Next to Type of Record, select SRV from the drop down
- Click Proceed
- Next to Hostname, you may either enter a specific hostname or leave the field empty to create the SPF for the entire domain
- Next to SRV Record, input the SRV record
- Once you have finished writing your SRV record, click Create SRV Record
Your SRV record is now complete.