בס״ד

SRV Record Lookup

An SRV record tells a client which host and port provide a specific service for a domain, using the name format _service._proto.name. Each record carries four values: priority, weight, port and target. DNSX looks up SRV records and resolves every target to its A and AAAA addresses, with geolocation and ASN.

$ curl https://dnsx.dev/dns/srv/_sip._tcp.example.com # targets resolved
$ dig SRV _sip._tcp.example.com +short

What is an SRV record?

An SRV record is a DNS resource record that advertises the location of a service: which host runs it, which port it listens on, and in what order clients should try the available hosts. It is defined in RFC 2782, published in 2000, and it is the only standard DNS record type that can carry a port number.

That port number is the whole point. An A record can only say "this name is at this address", so every protocol that relies on A records has to hard-code a default port. An SRV record lets the domain owner move a service to a different host and port, or add and remove servers, without touching anything on the client side.

An SRV record has six meaningful parts. Four of them are the record data: priority, weight, port and target. The other two are the service and transport protocol labels at the front of the owner name.

_sip._tcp.example.com.  3600  IN  SRV  10 60 5060 sip1.example.com.
    │    │      │          │          │  │   │        │
 service proto  name      TTL   priority │  port    target
                                       weight

What does the _service._proto.name format mean?

An SRV record is never published at the bare domain. Its owner name is built from three parts: an underscore-prefixed service label, an underscore-prefixed protocol label, and the domain the service belongs to. For SIP over TCP at example.com that is _sip._tcp.example.com.

The underscore prefix is deliberate. An underscore is not a legal character in a hostname under RFC 1123, so a label beginning with one can never collide with a real host in the same zone. That is what allows a zone to publish _sip._tcp and a host called sip side by side without ambiguity.

The protocol label is almost always _tcp or _udp, and it is part of the query name rather than the record data. A client that wants TCP queries the _tcpname and never sees records published under _udp. Publishing a service under the wrong protocol label makes it invisible rather than broken, which is why the mistake is so easy to miss.

Service labels are defined by whoever specifies the protocol, and there is no central rule beyond registered names. Common ones are shown in the examples table below.

How do priority and weight decide which server is used?

Priority and weight do two different jobs, and mixing them up is the most common SRV configuration error. Priority is failover. Weight is load balancing. They only interact within a single priority level.

FieldExampleClient behaviourBinding
Priority10Lower is tried first. Clients must exhaust every reachable target at priority 10 before trying priority 20.Mandatory to obey
Weight60Proportional load share among targets at the same priority. Weight 60 against weight 40 splits traffic 60/40.Advisory
Port5060The TCP or UDP port on the target host. Overrides any default port the client would otherwise assume.Mandatory
Targetsip1.example.com.Canonical hostname with an A or AAAA record. Must not be a CNAME. A single dot means the service is not offered here.Mandatory

A client must contact the reachable target with the lowest priority value. Only if every target at that priority fails does it move up to the next value. Priority 0 and priority 10 do not mean "90% and 10%". While priority 0 is answering, priority 10 receives no traffic at all.

Weight applies only among records that share a priority. RFC 2782 defines the selection as proportional: sum the weights in the group, pick a random number in that range, and walk the running total. With three targets at priority 10 and weights 60, 30 and 10, the split is roughly 60%, 30% and 10% of new connections.

A weight of 0 means "use this only if nothing else in the group is available", and when every record in a group has weight 0 the client picks at random among them. Setting all weights to 0 is the normal way to say "these are equivalent, balance them however you like".

; Primary pair, load balanced 60/40. Backup only used if both are down.
_sip._tcp.example.com. IN SRV 10 60 5060 sip1.example.com.
_sip._tcp.example.com. IN SRV 10 40 5060 sip2.example.com.
_sip._tcp.example.com. IN SRV 20  0 5060 sip-dr.example.com.

Does an SRV target need its own A or AAAA record?

Yes. An SRV record resolves to a hostname, not to an address, so the target is only useful if a second lookup can turn it into an IP. RFC 2782 states that the target must be a hostname with one or more address records in the same or another zone. A target with no A and no AAAA record is a dead SRV record, even though the SRV query itself succeeds.

This is the failure mode that makes SRV debugging frustrating: dig SRV returns a perfectly formed answer, so the record "exists", and the client still cannot connect. Resolving every target is the only way to see it, which is why this tool follows each target down to its addresses and shows the geolocation and ASN of what it lands on.

The target must also be fully qualified. A target written without a trailing dot in a zone file has the zone origin appended, so sip1.example.com silently becomes sip1.example.com.example.com. Check this first whenever a target does not resolve.

Can an SRV record point at a CNAME?

No. RFC 2782 requires the SRV target to be the canonical name of the host, and explicitly says the target must not be an alias. The same rule applies to MX and NS targets, and for the same reason: a resolver following a CNAME at that position adds a lookup that some clients simply do not perform.

In practice the outcome is inconsistent rather than uniformly broken, which makes it worse. Many resolvers will chase the CNAME and the service works. Strict clients and some libraries treat the answer as invalid and fail. A service that works from your laptop and fails from a server is very often an SRV target pointing at a CNAME.

A target of a single dot, ., is the one special case. A lone SRV record with target . is a positive declaration that the service is not available at this domain, and a client that sees it should stop rather than fall back to a default host and port.

Why does my SRV record exist but the service still fails?

An SRV query returning an answer proves only that the record was published. Every one of the following will produce a valid-looking SRV answer and a service that does not work:

  • The client does not read SRV at all. Web browsers ignore SRV records entirely, so there is no way to move a website to a non-default port with DNS. Minecraft Bedrock Edition ignores them too, while Java Edition honours them.
  • The target has no A or AAAA record, or has one only for the address family the client is using.
  • The target is a CNAME, which strict clients reject.
  • The target lost its trailing dot in the zone file and had the origin appended.
  • The record is under the wrong protocol label, published at _udp while the client queries _tcp. The client sees NXDOMAIN, not a wrong answer.
  • The port in the record is not the port the service listens on, or a firewall blocks it. SRV advertises a port. It does not open one.
  • The record is published at the wrong name, at _sip._tcp.sip.example.com instead of _sip._tcp.example.com.
  • An old answer is still cached. Resolvers hold the previous record until its TTL expires, so lower the TTL before making a change rather than after.

Resolve the targets, not just the record

The DNS lookup tool follows every SRV target to its A and AAAA addresses, so a target that does not resolve is visible immediately.

Open the SRV flow view

Which services use SRV records?

Service labelUsed byExample recordNotes
_sip._tcpSIP / VoIP signalling_sip._tcp.example.com. IN SRV 10 60 5060 sip1.example.com.Usually reached via a NAPTR record first. _sips._tcp on port 5061 carries the TLS variant.
_xmpp-server._tcpXMPP / Jabber federation_xmpp-server._tcp.example.com. IN SRV 5 0 5269 xmpp.example.com.Clients use _xmpp-client._tcp on port 5222. Both must be published for a federated server.
_autodiscover._tcpExchange / Outlook autodiscover_autodiscover._tcp.example.com. IN SRV 0 0 443 autodiscover.example.com.Outlook falls back to this after trying the autodiscover URL. Port 443 is expected.
_minecraft._tcpMinecraft Java Edition server_minecraft._tcp.play.example.com. IN SRV 0 5 25565 mc.example.com.Lets players connect without typing a port. Bedrock Edition does not read SRV records.
_ldap._tcpActive Directory domain controllers_ldap._tcp.dc._msdcs.example.com. IN SRV 0 100 389 dc1.example.com.AD publishes a large tree of SRV records under _msdcs, and a missing one breaks domain join.

SIP is the odd one out in that table. A SIP client does not usually query SRV first. It queries NAPTR at the bare domain to find out which transports the domain supports, and the NAPTR record hands it the SRV name to query next. If you are debugging SIP, start at the NAPTR lookup page, which walks the whole NAPTR → SRV → A chain.

Frequently Asked Questions

What is an SRV record?
An SRV record tells a client which host and port provide a specific service for a domain, using the format _service._proto.name. It carries four values: priority, weight, port and target.
How do SRV priority and weight work?
Clients must use the lowest priority value that is reachable. Weight only distributes load within one priority level, so a target with weight 30 receives roughly three times the traffic of a target with weight 10 at the same priority.
Can an SRV target be a CNAME?
No. RFC 2782 requires the target to be a hostname with an A or AAAA record. Pointing it at a CNAME is a common misconfiguration and many clients will fail to connect.
What does the underscore in _sip._tcp mean?
The underscore prefix marks the label as a service label rather than a hostname, which is invalid in normal hostnames and therefore guarantees no collision with a real host.
Can an SRV record have a target of "."?
Yes. A single SRV record with target "." explicitly declares that the service is not available at that domain.

Related Tools