SIP DNS and SRV records explained
A SIP domain such as example.com is not a server. DNS turns it into one, and the record that does the work is SRV. This guide covers how a SIP client finds a server, what each field of an SRV record means, which service names exist, how priority and weight decide failover, how DNS ties into TLS certificates, and how to look the records up yourself.
How a SIP client finds a server
RFC 3263 describes the lookup a SIP client runs for an address with no port. It may start with NAPTR records, which say which transports the domain prefers; few SIP domains publish them and many clients skip that step. It then asks for the SRV records of each transport it can use, and if a domain has none at all it asks for the domain's own A records and uses the default port.
In practice most PBXs, SBCs and proxies go straight to SRV for the transport they are configured with, and some only look up SRV when told to. One rule is close to universal: a port in the address skips SRV. sip:example.com:5060 is resolved as an A record on 5060, while sip:example.com gets the SRV lookup, so the same domain can reach different servers depending on how a peer typed it.
What is an SRV record?
An SRV record, defined in RFC 2782, maps a service at a domain to a host and port, with numbers that rank the hosts. A typical SIP record for TLS looks like this:
_sips._tcp.example.com. 3600 IN SRV 10 60 5061 sbc1.example.com.| Field | In the example | Meaning |
|---|---|---|
| Service | _sips |
The protocol, with an underscore; sips asks for SIP over TLS |
| Protocol | _tcp |
The transport the service runs on |
| Name | example.com. |
The SIP domain the record belongs to |
| TTL | 3600 |
Seconds a resolver may cache the answer |
| Priority | 10 |
Lower is tried first; equal values share the traffic |
| Weight | 60 |
Relative share among records of the same priority |
| Port | 5061 |
Where the server listens for this service |
| Target | sbc1.example.com. |
The host to connect to; it needs its own A record |
SIP service names: _sip._udp, _sip._tcp, _sips._tcp
SIP uses three service names: _sip._udp for plain SIP over UDP, _sip._tcp for plain SIP over TCP, and _sips._tcp for SIP over TLS. Each is a separate set of records, so a domain can send UDP to one host and TLS to another, or offer only one of the three.
There is no _sip._tls in RFC 3263: TLS is expressed by the sips service over TCP. The name still turns up because Microsoft Lync and Skype for Business Server use a _sip._tls record to point their own clients at the Access Edge server. Standard SIP clients never query it, so it does nothing for a SIP trunk.
Priority and weight: failover and load sharing
Priority decides order and weight decides sharing. A client tries the records with the lowest priority first and only moves to a higher number when none of those answer. Records that share a priority split the traffic in proportion to their weights, and a weight of 0 means the record gets traffic only when no other choice is left.
Two SBCs show both patterns. With the records below, every call goes to sbc1 while it answers, and sbc2 takes over only when sbc1 does not:
_sip._udp.example.com. 3600 IN SRV 10 0 5060 sbc1.example.com.
_sip._udp.example.com. 3600 IN SRV 20 0 5060 sbc2.example.com.Give both records priority 10 and weights 70 and 30, and roughly seven calls in ten go to sbc1 and three to sbc2, with each still covering for the other.
PingVo tests every endpoint in the same failover order on every check: priority, then weight from highest to lowest, then name. It does not pick at random by weight as a client would, so each endpoint keeps a history you can compare from one minute to the next, and a backup that nobody sends traffic to still gets tested.
SRV or an A record?
Publish SRV when the domain has more than one SIP server, when a listener uses a non-default port, or when peers are given only the domain and should find the server on their own. Carriers and SIP providers with several edge nodes nearly always do.
An A record and a port in the peer's settings are enough for a single server on a known port, and they leave less room for surprises. Several A records for one name are not a substitute for SRV: a resolver may return them in any order, and the client picks one with no rule for which is primary and which is the backup.
DNS and TLS: which name the certificate needs
DNS and TLS meet at one question: which name must the server's certificate carry? RFC 5922 answers that a SIP client checks the certificate against the domain it was asked to reach, not against the SRV target. A client given example.com that lands on sbc1.example.net through SRV expects example.com in the certificate, and it sends example.com in the TLS SNI.
Many carriers do it differently and issue one certificate per node, naming only the target. Some clients accept that, others follow the RFC and fail the name check, so the same server can work with one peer and not another. PingVo monitoring accepts either name, and the free check says which one matched. A DNS change that moves a domain to new targets is a common cause of TLS failures that begin overnight. See SIP TLS explained and certificate names under SRV.
TTL and DNS changes
Every record carries a TTL, the number of seconds a resolver may keep its answer. With a TTL of 3600, a carrier's resolver can go on using the old target for up to an hour after you change it, and some SIP stacks hold their own cache on top of that.
Before a migration, lower the TTL of the records you will change to 300 or less, and do it at least one old TTL ahead, so the short value is what everyone has cached on the day. Raise it again once the move has settled. This is why a DNS change can take hours to reach a carrier even when your own lookup already shows the new answer.
How to look up SIP SRV records
Any of these shows the SRV records a domain publishes. Query from outside your own network when you can, because an internal resolver may know names the internet does not.
dig
dig +short SRV _sip._udp.example.comEach line is priority, weight, port and target, such as 10 60 5060 sbc1.example.com.; no output means no records of that service.
nslookup
nslookup -type=SRV _sips._tcp.example.comLook for the priority, weight, port and svr hostname lines; No answer means the name exists without SRV records.
PowerShell
Resolve-DnsName -Type SRV _sip._tcp.example.comThe NameTarget, Priority, Weight and Port columns give the same four values, one row per record.
The free SIP OPTIONS check does the lookup and the test in one go. Leave the port empty and it queries the SIP services, lists every endpoint in failover order with notes on anything set up wrong, and sends one OPTIONS to the endpoint you choose.
Common SIP DNS problems
Each DNS problem has its own guide with the records involved, the messages you may see, the usual causes and the fixes.
- No SRV records: The SIP domain publishes no SRV records, so clients fall back to its A records.
- Target is a CNAME: An SRV record points at an alias, which RFC 2782 does not allow.
- Target has no IPv4: An SRV target has no A record, so IPv4 clients cannot reach it.
- Port and transport mismatch: An SRV record pairs a service with the port of a different transport, such as 5061 under _sip._udp.
- Service not offered: A lone "." as the SRV target means the domain offers no SIP on that transport.
- Name doesn't resolve: The SIP server's name returns NXDOMAIN or SERVFAIL, or the lookup times out.
- Private address in DNS: A public name resolves to a private or reserved address that callers outside cannot reach.
SIP DNS monitoring
A lookup from your desk shows one moment. PingVo monitoring resolves your SIP domain on every check and tests every endpoint each minute, so a backup SBC that stops answering is found while the primary still works, not on the day it is needed. It tells you when the records change, so an edit nobody announced does not go unnoticed, and it warns you weeks before the domain's registration expires.