SIP Fundamentals

SIP SRV Records (DNS-based server discovery)

DNS SRV records (RFC 2782) let a SIP client discover where to send an INVITE or REGISTER without a hard-coded host:port. They carry priority, weight, port, and target, and they are the middle stage of the three-stage RFC 3263 lookup (NAPTR → SRV → A/AAAA) that lets one carrier hostname route across multiple POPs, balance load by weight, and fail over without any PBX-side change.

Record format

An SRV record returns four fields per result, queried under the name _service._proto.domain. For SIP, the service names are _sip and _sips; the protocols are _udp and _tcp.

$ dig +short SRV _sips._tcp.example.com
10 5 5061 sip-edge.example.com.

Reads as: priority 10, weight 5, port 5061, target sip-edge.example.com. A normal A/AAAA query on the target then gives the IPs.

Priority vs weight

Two numbers, two jobs:

_sips._tcp.example.com.  10 50  5061 pop-us-east-1.example.com.
_sips._tcp.example.com.  10 50  5061 pop-us-east-2.example.com.
_sips._tcp.example.com.  20 100 5061 pop-us-west-1.example.com.

Two co-primary east POPs splitting traffic 50/50; west is the failover only used when both east targets are unreachable.

The RFC 3263 resolution chain

Given a SIP URI like sip:[email protected], a compliant client performs three lookups:

  1. NAPTR on the domain, advertises supported transports (SIPS+D2T, SIP+D2T, SIP+D2U) and points to the SRV name to query next.
  2. SRV on the chosen _service._proto.domain, returns priority/weight/port/target.
  3. A / AAAA on the SRV target, returns the IP(s) to connect to.

If NAPTR is missing, the client falls back to SRV queries in a defined order (_sips._tcp_sip._tcp_sip._udp). If SRV is also missing, it falls back to a direct A/AAAA on the URI host using the default port for the transport.

INVITE vs REGISTER

Both follow the same DNS rules. The difference is post-resolution behaviour:

Which engines honour SRV

Honour SRV by default: Asterisk pjsip (13+), FreeSWITCH (sofia), Kamailio (add dns_srv_lb = 1 for weighted balancing), OpenSIPS (use_dns_failover = yes), modern Polycom / Yealink / Snom firmware. FreePBX and 3CX honour SRV when trunks are configured by hostname only with the port left blank. Microsoft Teams Direct Routing hard-codes its SBC FQDN+port and does not consult SRV at the Teams → SBC hop (carrier-side SRV still works normally). Cisco CUCM needs SRV explicitly enabled on the SIP trunk profile; Avaya Aura supports it but rarely uses it in practice.

Common gotchas

Related terms

Related glossary terms

Ready to get a number?

Pick a DID in 130+ countries from $1.99/month. Activates instantly on most numbers.