Skip to content

SRV Record Lookup

An SRV record publishes where a specific service runs: its hostname *and* port, plus priority and weight for failover and load sharing. Unlike A or MX records, SRV names encode the service and protocol — _sip._tcp.example.com — so you must query the full underscore name, not the bare domain.

The name format is the hard part

SRV records (RFC 2782) live at names of the form _service._proto.name. Both the service and the protocol labels are prefixed with an underscore, and both are required. Querying example.com for SRV records returns nothing, always — and that empty answer is correct, not a failure. You have to know which service you are asking about.

dig +noall +answer _sip._tcp.tel.t-online.de SRV
_sip._tcp.tel.t-online.de. 3600 IN SRV 10 0 5060 stg010-l01-mav-pc-rb-001.edns.t-ipnet.de.
_sip._tcp.tel.t-online.de. 3600 IN SRV 20 0 5060 nes008-f01-mav-pc-rb-001.edns.t-ipnet.de.
_sip._tcp.tel.t-online.de. 3600 IN SRV 30 0 5060 hno002-f01-mav-pc-rb-001.edns.t-ipnet.de.
A real SIP service: three targets at descending preference, all on port 5060.
FieldExampleMeaning
Priority10Lowest number is tried first, exactly like MX preference. Higher numbers are backups.
Weight0Relative share of traffic among records at the same priority. A weight of 0 with no siblings means "no preference".
Port5060The TCP or UDP port the service listens on. This is what SRV adds over a plain A record.
Targetstg010-…t-ipnet.de.A hostname with A/AAAA records. It must not be a CNAME, and a single dot means the service is explicitly not available.

Weight only applies within a priority level. Given two records at priority 10 with weights 30 and 70, clients should send roughly 30% and 70% of connections respectively. Across different priorities, weight is irrelevant — priority 20 is touched only when everything at priority 10 fails.

Read the full explanation of srv record lookup results ↓

Service names you will actually meet

  • _sip._tcp and _sip._udp — SIP signalling. _sips._tcp for TLS-protected SIP.
  • _xmpp-client._tcp and _xmpp-server._tcp — XMPP client and server-to-server connections.
  • _ldap._tcp and _kerberos._tcp — directory and authentication. Active Directory publishes a large set under _msdcs, and domain join fails outright when they are missing.
  • _autodiscover._tcp — Microsoft Exchange and Microsoft 365 client configuration.
  • _caldavs._tcp and _carddavs._tcp — calendar and contacts autodiscovery for Apple and other clients.
  • _minecraft._tcp — lets players connect without typing a port number.
  • _matrix._tcp (now largely superseded by the .well-known delegation method) — Matrix homeserver discovery.
A target of a single dot (.) is meaningful: RFC 2782 defines it as "this service is definitively not available at this domain". It stops clients from falling back to guesswork, which is occasionally exactly what you want.

How to read the results

  • Records returned — read the priority column first. That is the order clients will try, and it is where a failover misconfiguration shows up.
  • No records at the underscore name — either the service is not published, or you have the service/protocol label wrong. Try both _tcp and _udp before concluding anything.
  • NXDOMAIN — the underscore name itself does not exist. That is the same as "no SRV published" for practical purposes, though it means no record of any type exists at that name.
  • A target that does not resolve — the SRV record is valid but useless. Always follow up with an A record lookup on the target.
  • A port nothing is listening on — DNS cannot tell you this. Confirm with the port checker; an SRV record pointing at a closed port is the most common "the record is right but it does not work" case.

Common failures and fixes

  1. Underscores stripped or rejected by the control panel. Some panels refuse underscore labels or add the domain twice, producing _sip._tcp.example.com.example.com. Query the exact name here to see what was really published.
  2. Target is a CNAME. RFC 2782 forbids it. Some clients follow it anyway, others fail; you get intermittent, client-dependent breakage. Point the target at a name with real A/AAAA records.
  3. A port number in the target field. The target is a hostname only. The port belongs in its own field — that is the entire point of SRV.
  4. All records at the same priority when you wanted failover. Equal priorities mean load sharing, not failover. Give the backup a higher number.
  5. Provider expects separate fields. Many panels split priority, weight, port, and target into four inputs, and pasting the whole record into one field yields garbage. Check the result here after saving.
  6. Client ignores SRV entirely. Plenty of software never looks up SRV records — web browsers, notably, do not. SRV only works when the client implements it.

Querying SRV from the command line

# The SRV records themselves
dig +short _sip._tcp.tel.t-online.de SRV

# With TTLs and the full answer section
dig +noall +answer _xmpp-server._tcp.jabber.org SRV

# Resolve each target to an address
for t in $(dig +short _sip._tcp.example.com SRV | awk '{print $4}'); do
  echo -n "$t -> "; dig +short "$t" A | tr '\n' ' '; echo
done

# Confirm something is actually listening on the advertised port
nc -vz sipserver.example.com 5060
The awk field is the target; fields 1-3 are priority, weight, and port.

If you are debugging a service that will not connect, work the chain in order: does the SRV name resolve, does the target resolve, is the port open. Each step has a different owner and a different fix, and skipping straight to the application logs wastes time. The full DNS lookup accepts underscore names too if you want to see every record type at once.

Frequently asked questions

Why does my SRV lookup return nothing for my domain?
Because SRV records never live at the bare domain. They live at _service._proto.domain — for example _sip._tcp.example.com. Query the full underscore name. If that also returns nothing, the service is genuinely not published, or the service/protocol labels differ from what you assumed.
What is the difference between priority and weight?
Priority is failover order: the lowest number is used first, and higher numbers are only reached when everything below has failed. Weight distributes load among records that share the same priority, proportionally. Weight has no meaning across different priority levels.
Can an SRV target be a CNAME?
No. RFC 2782 requires the target to be a name with A or AAAA records. Some clients tolerate a CNAME, many do not, and the failures are inconsistent and hard to reproduce. Publish A/AAAA records at the target name instead.
Why does my email not use SRV records?
SMTP predates SRV and uses MX records, which carry no port because SMTP is defined to use port 25. Some mail-adjacent services do use SRV — _autodiscover._tcp for Exchange client configuration, _submission._tcp for submission discovery — but message routing itself is MX-only. Check yours with the MX lookup.
Do web browsers use SRV records?
No. HTTP has no SRV convention; browsers resolve A/AAAA and connect to 80 or 443. The HTTPS/SVCB record types (RFC 9460) are the modern equivalent for the web and carry similar information, but they are a separate record type from SRV.
How do I test whether the service behind an SRV record works?
Resolve the target to an address, then confirm the advertised port accepts connections with the port checker or nc -vz host port. DNS only advertises where a service should be; it has no idea whether anything is listening there.
What does a target of "." mean?
It is an explicit statement that the service is not available at this domain. It is defined in RFC 2782 and is more useful than publishing nothing, because it tells conforming clients to stop rather than fall back to guessing hostnames and ports.