Emergency server help: get in touch

SIP SRV Records: DNS Setup for 3 Transport Types

How SIP clients find a server through DNS (NAPTR, then SRV, then A/AAAA), the exact records to create for UDP, TCP and TLS, how priority and weight give failover, and how to test the result.

Published Updated 9 min read

SIP SRV records let phones, PBXs and trunk providers find your SIP server by domain name alone, and they give you failover between servers without touching a single phone. RFC 3263 defines the lookup: a client resolving sip:example.com first asks for NAPTR records to choose a transport, then for SRV records to get host and port, and finally for the A or AAAA address. This guide shows the records to publish and how to check them.

Short answer: Publish one SRV record per transport, _sip._udp, _sip._tcp and _sips._tcp, each pointing to an A/AAAA hostname (not a CNAME) with the right port: 5060 for UDP and TCP, 5061 for TLS. Use lower priority numbers for the primary server and a higher number for the backup, and weight to split load between servers of equal priority. Add NAPTR records if clients should prefer TLS, then verify with dig SRV _sip._udp.example.com. (Reviewed November 2026.)

Record format

An SRV record has four values after the type: priority, weight, port and target host.

; name                          TTL   class type priority weight port target
_sip._udp.example.com.          3600  IN    SRV  10       60     5060 sip1.example.com.
_sip._udp.example.com.          3600  IN    SRV  10       40     5060 sip2.example.com.
_sip._udp.example.com.          3600  IN    SRV  20       0      5060 sip-dr.example.com.
_sip._tcp.example.com.          3600  IN    SRV  10       0      5060 sip1.example.com.
_sips._tcp.example.com.         3600  IN    SRV  10       0      5061 sip1.example.com.
sip1.example.com.               3600  IN    A    203.0.113.10
sip2.example.com.               3600  IN    A    203.0.113.11
sip-dr.example.com.             3600  IN    A    198.51.100.20

Clients always try the lowest priority first. Within the same priority, weight sets the share of traffic, so the example sends about 60% to sip1 and 40% to sip2, and only uses sip-dr if both fail. The TCP and TLS records in this sample list only sip1, so TCP and TLS clients have no failover target. For redundancy on every transport, give _sip._tcp and _sips._tcp the same three targets with the same priorities and weights as _sip._udp.

How a client finds your server

Whether SRV records are used at all depends on what the phone or PBX is given as the server address. RFC 3263 sets these rules:

Server address configuredDNS lookupsPort used
198.51.100.20 (an IP address)NoneThe one given, or 5060 (5061 for TLS)
example.com:5060 (name with a port)A/AAAA for example.com onlyThe one given
example.com;transport=tcpSRV for _sip._tcp.example.com, then A/AAAAFrom the SRV record
example.com (name only)NAPTR, then the SRV it points to, then A/AAAA. With no NAPTR, SRV for each transport the client supportsFrom the SRV record
example.com, but no NAPTR or SRV existsA/AAAA for example.com5060 over UDP for sip:, 5061 over TLS for sips:

Note the second row: even an explicit :5060 turns SRV off. Older SIP software (RFC 2543) still used SRV when the port was 5060; RFC 3263 changed that.

Choose a record pattern

GoalPriority and weightNotes
One serverOne record per transport, any priority, weight 0RFC 2782 suggests weight 0 when there is nothing to choose between
Active and standbyPrimary 10, standby 20The standby only gets traffic when the primary fails
Load sharingSame priority, weights such as 60 and 40Shares are probabilities per client, not exact splits
Turn a transport offPriority 0, weight 0, port 0, target .A target of “.” means the service is not available at this domain

For example, to tell clients that you do not offer SIP over UDP at all:

_sip._udp.example.com.          3600  IN    SRV  0        0      0    .

Mixing a weight of 0 with non-zero weights at the same priority gives the weight-0 server only a very small share, so do not use 0 for a server you expect to carry real traffic.

NAPTR records for transport choice

NAPTR records tell clients which transports exist and which to prefer. Lower order values win. This set prefers TLS, then TCP, then UDP:

example.com. 3600 IN NAPTR 10 50 "s" "SIPS+D2T" "" _sips._tcp.example.com.
example.com. 3600 IN NAPTR 20 50 "s" "SIP+D2T"  "" _sip._tcp.example.com.
example.com. 3600 IN NAPTR 30 50 "s" "SIP+D2U"  "" _sip._udp.example.com.

NAPTR is optional. Without it, clients fall back to querying the SRV names directly, usually trying UDP first.

If you do publish NAPTR for a proxy or registrar, RFC 3263 asks for all three services shown above (SIPS+D2T, SIP+D2T and SIP+D2U), with SIPS preferred. Keep the SRV records under your own domain as well, even if a NAPTR replacement points to another domain: older clients skip NAPTR and query _sip._udp.example.com directly.

Create them at your DNS host

In Cloudflare, cPanel Zone Editor or DirectAdmin DNS management choose type SRV and fill in the service (_sip), protocol (_udp, _tcp), priority, weight, port and target as separate fields. Keep the SIP host records DNS-only in Cloudflare; the orange-cloud proxy only handles web traffic and will break SIP if applied to the target hostname.

Test the lookup

dig +short NAPTR example.com
dig +short SRV _sip._udp.example.com
dig +short SRV _sips._tcp.example.com
dig +short A sip1.example.com

# TLS 1: trusted chain and a certificate valid for the SIP domain itself
openssl s_client -connect sip1.example.com:5061 -servername example.com \
  -verify_hostname example.com -verify_return_error </dev/null 2>&1 | grep -E "Verify return code|verify error"
# TLS 2: the same certificate checked against the SRV target name
openssl s_client -connect sip1.example.com:5061 -servername sip1.example.com \
  -verify_hostname sip1.example.com -verify_return_error </dev/null 2>&1 | grep -E "Verify return code|verify error"
# TLS 3: names and expiry
openssl s_client -connect sip1.example.com:5061 -servername example.com </dev/null 2>/dev/null \
  | openssl x509 -noout -subject -ext subjectAltName -dates

Both TLS checks should end with Verify return code: 0 (ok). A subject and expiry date only prove that a certificate was presented, not that a phone will trust it. Which name the certificate must carry depends on the client. RFC 5922 says a client that found the server through SRV checks the certificate against the original SIP domain (example.com), not the SRV target, because the SRV answer itself is not authenticated. In practice many phones and providers check the target host name instead. The safe setup is a certificate from a CA the phones trust, with both example.com and sip1.example.com in its subjectAltName, and the same on every TLS target. Repeat the checks for each _sips._tcp target. You can run the same checks in one go with the free SIP SRV checker on srvScripts.

After a change, ask your authoritative name server directly so a resolver cache does not hide the result, then check the status line of a full answer:

dig +noall +answer SRV _sip._udp.example.com @ns1.example.com   # straight from the zone
dig SRV _sip._udp.example.com | grep status                     # NOERROR or NXDOMAIN
  • NXDOMAIN: the name does not exist at all. Look for a typo in the service or protocol label, or a record created under the wrong zone.
  • NOERROR with no answer: the name exists but has no SRV record, for example because it was saved as another record type.
  • Answer from @ns1 but not from a public resolver: the old result is still cached. Wait for the previous TTL to run out; a cached “does not exist” answer lasts for the zone’s negative-caching TTL from its SOA record.

How failover behaves

SRV records only list the servers; the client decides when to move on. Under RFC 3263 a client tries the next target when a request gets a 503 Service Unavailable, when the transport fails (an ICMP error on UDP or a refused TCP connection), or when no response at all arrives before the transaction times out.

  • A silent server is the slow case. With the default RFC 3261 timers an unanswered INVITE over UDP times out after 32 seconds (64 × T1 of 500 ms), so the first call after an outage can wait that long. Many phones and PBXs remember a dead server or probe it with OPTIONS, which makes later calls fail over faster; check the device’s failover settings.
  • Other errors do not trigger failover. A 403, 404 or 486 is a real answer from a working server, so the client does not try the backup.
  • Calls already up stay where they are. Requests inside a call, such as BYE or a re-INVITE, go to the address learned from the Contact and Record-Route headers, not to the domain’s SRV records.

Common mistakes

  • Pointing an SRV target at a CNAME, which RFC 2782 forbids and some clients reject.
  • Leaving a trailing dot off the target in zone files, which appends the zone name again, so the target becomes sip1.example.com.example.com.
  • Configuring the trunk with a hostname plus explicit port, which skips the SRV lookup entirely; enter the domain alone if you want SRV-based failover.
  • Very long TTLs that slow down failover changes; 300 to 3600 seconds is a sensible range.
  • Publishing TLS as _sip._tls. RFC 3263 clients look for TLS under _sips._tcp.
  • Publishing a SIPS+D2U NAPTR record. TLS cannot run over UDP, and RFC 3263 says this record should not be in the DNS.

SIP SRV records at a glance

SIP SRV Records summary card: Publish one SRV record per transport, _sip._udp, _sip._tcp and _sips._tcp, each pointing to an A/AAAA hostname (not a…
In short: Publish one SRV record per transport, _sip._udp, _sip._tcp and _sips._tcp, each pointing to an A/AAAA hostname (not a CNAME) with the right port: 5060 for UDP and TCP, 5061 for TLS.
SIP SRV Records – questions answered
SIP SRV Records: the questions this guide answers.

Official documentation: RFC 3263: locating SIP servers, RFC 2782: DNS SRV, RFC 5922: SIP domain certificates, openssl s_client manual, Cloudflare DNS record types.

Related guides: SIP ports firewall rules · Disable SIP ALG · Migrate PBX to cloud.

Frequently asked questions

Do I need SIP SRV records for a cloud phone system?

Usually not. Cloud phone apps connect to the provider’s own servers. SRV records matter when you run your own PBX, federate with other SIP domains, or when a provider asks you to publish them.

Can an SRV target be a CNAME?

No. RFC 2782 requires the target to have A or AAAA records directly. Some resolvers tolerate a CNAME, but phones and PBXs may not, so always point to an address record.

Why is my PBX ignoring the SRV records?

The trunk is probably configured with an IP address or a hostname plus port, which bypasses SRV. Configure the domain only, without a port, and check the PBX’s DNS resolver can reach public DNS.

How long does SIP SRV failover take?

It depends on how the primary fails. A 503 or a refused connection sends the client to the next target straight away. A server that does not answer at all makes an INVITE over UDP wait up to 32 seconds with the default timers. Phones and PBXs that remember a dead server fail over faster on later calls.

What does an SRV record with a target of “.” mean?

It says the service is not available at that domain. Publish it with priority, weight and port set to 0 to tell clients not to try a transport you do not offer, for example _sip._udp when you only accept TCP and TLS.

Share this guide

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.