DNS Record Types
SRV Records: Service Discovery in DNS
9 min read · Updated 2026-06-19
An SRV record (Service record) lets a domain advertise where a particular service runs — both the host and the port that clients should connect to. Instead of assuming a service always lives on a fixed, well-known location, a client can look it up in DNS and be pointed to the right server and port.
That makes SRV a general-purpose tool for service discovery: it's how VoIP phones find your SIP server, how chat clients find your XMPP server, and how a Windows machine finds the domain controllers for an Active Directory domain. This guide explains the naming convention, the four data fields, and the rules that keep an SRV record valid.
What an SRV record is and what it does
An SRV record maps a named service on a domain to the server (and port) that provides it. Where an A or AAAA record answers "what IP is this hostname?", an SRV record answers "for service X on this domain, which host and port should I talk to?"
The key thing SRV adds over a plain address record is the port number. A client doesn't have to assume the service sits on a fixed, hardcoded port — the record tells it. That lets you move a service to a different machine, run it on a non-standard port, list backups, and load-balance, all by editing DNS rather than reconfiguring every client.
SRV is defined by RFC 2782. A protocol has to be designed to use SRV for it to matter — the client must know to perform the SRV lookup. Many do; ordinary web browsers do not (see below).
The naming convention: _service._proto.name
SRV records don't sit on the bare domain name. They live at a structured, prefixed name in the form:
_service._proto.name
_service— the symbolic name of the service, such as_sip,_xmpp-client, or_ldap._proto— the transport protocol, almost always_tcpor_udp.name— the domain the lookup applies to, e.g.example.com.
So a SIP service over TCP for example.com is published at _sip._tcp.example.com.
The leading underscores are literal characters, not placeholders. They are required by the spec, and they serve a practical purpose: underscores aren't legal in normal hostnames, so prefixing the labels with _ guarantees these service labels can never collide with a real host's A/AAAA name. Other DNS conventions use the same trick — for example DKIM's _domainkey and DMARC's _dmarc labels.
The four data fields: priority, weight, port, target
The right-hand side (the record's data) has exactly four fields, in this order:
| Field | Type | Meaning |
|---|---|---|
| Priority | 16-bit unsigned (0–65535) | Which target to prefer. Lower is preferred — clients use the lowest-priority targets first and only fall back to higher numbers if those fail. |
| Weight | 16-bit unsigned (0–65535) | A relative share for load-balancing among targets that share the same priority. Higher weight means a proportionally larger share of connections. |
| Port | 16-bit unsigned (0–65535) | The TCP or UDP port the service listens on at the target host. |
| Target | Hostname | The fully qualified hostname of the server providing the service, ending in a dot. It must have A/AAAA records. A single . means the service is explicitly not available. |
A couple of these deserve emphasis. Priority works like MX preference: the smallest number wins, and higher numbers are backups. Weight only matters within a single priority level — if two targets are both priority 10 with weights 60 and 40, they'll receive roughly 60% and 40% of connections respectively. And a target of . (just a dot) is the spec's way of saying "this service is deliberately not offered here," which a client should treat as definitive.
A worked example: SIP over TCP
Suppose example.com wants to publish where its SIP (VoIP) service lives. It runs on sipserver.example.com, port 5060, over TCP. The record is published at the prefixed name and looks like this in a zone file:
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 sipserver.example.com.
Reading the data fields left to right: priority 10, weight 60, port 5060, target sipserver.example.com. (note the trailing dot marking a fully qualified name).
Here is how a SIP client uses it:
- It needs to reach SIP for
example.com, so it queries DNS for the SRV records at_sip._tcp.example.com. - It groups the returned records by priority and starts with the lowest number. If several share that priority, it picks among them in proportion to their weights.
- It takes the chosen target's hostname —
sipserver.example.com— and resolves its A/AAAA record to an IP address. - It connects to that IP on the port from the record —
5060— rather than guessing a default. - If that target fails, the client falls back to the next target by priority and tries again.
The client never had to assume which machine or port runs SIP; DNS told it both.
Who uses SRV records in the real world
SRV is used by protocols whose clients are built to look it up. Common examples:
- SIP / VoIP —
_sip._tcp,_sip._udp, and_sips._tcppoint phones and softphones at the right call server. - XMPP (chat) —
_xmpp-client._tcpand_xmpp-server._tcplet chat clients and federated servers find each other. - LDAP —
_ldap._tcpadvertises directory servers. - Microsoft Active Directory — AD leans heavily on SRV. Domain-joined machines locate domain controllers via records like
_ldap._tcp.dc._msdcs.example.comand_kerberos._tcp. Mail clients also use_autodiscover._tcpto find Exchange/Outlook settings. - Minecraft (Java edition) — a
_minecraft._tcpSRV record lets a server run on a custom port while players still connect using just the domain name.
In each case the appeal is the same: the operator can move the service or change its port by editing one DNS record, and every compliant client follows automatically.
Rules and gotchas: target must be a real host
The most important rule mirrors the one for MX records: the target must be a real hostname that resolves through an A or AAAA record.
- Never an IP literal. The target field holds a hostname, not an address.
... 5060 198.51.100.10is invalid — point it at a name likesipserver.example.comthat itself has an A/AAAA record. - Never a CNAME. RFC 2782 requires the SRV target to be a hostname with address records directly, not an alias. Pointing an SRV target at a CNAME is non-conformant and can cause clients to fail.
- End the target with a dot. In a raw zone file
sipserver.example.com.is fully qualified; without the trailing dot some DNS hosts will append the zone and producesipserver.example.com.example.com. - A target of
.means "no service." If you genuinely want to advertise that a service is not offered, that's the way — but make sure you didn't enter it by accident, because clients treat it as a hard "don't bother."
SRV vs. MX: the key difference
SRV and MX are easy to confuse because both list a preference/priority and a target hostname. The differences that matter:
- MX is mail-specific; SRV is general-purpose. MX only ever directs inbound email for a domain. SRV can advertise the location of any service that's designed to use it.
- SRV carries a port; MX does not. MX has no port field — server-to-server mail delivery is always assumed to use SMTP on port 25. An SRV record explicitly names the port, so the service can live anywhere.
- SRV uses a prefixed name. MX sits on the bare domain (
example.com); SRV lives at the structured_service._proto.namelabel. - SRV adds weight. MX balances same-preference servers in a simple balanced/random order, while SRV gives you an explicit weight field to set the proportion of traffic among equal-priority targets.
The shared rule is the target one: in both records the hostname must have A/AAAA records and must not be an IP or a CNAME.
Not everything uses SRV (including the web)
SRV is opt-in by protocol. A service is only discoverable this way if its clients are written to perform the SRV lookup first. If they aren't, publishing an SRV record does nothing.
The most common surprise: ordinary web browsers do not use SRV for normal HTTP/HTTPS. A browser loading https://example.com resolves the domain's A/AAAA record and connects on the standard port (443) — it never consults an _http or _https SRV record. So you can't relocate a website to a different host or port with an SRV record; for the web you use A/AAAA, CNAME, and where supported newer mechanisms, not SRV.
The practical takeaway: add SRV records for the services that actually rely on them (SIP, XMPP, AD, Minecraft, and so on), and don't expect them to influence protocols — like plain web browsing — that were never designed to read them.
How to look up SRV records on who.is
You can inspect the live SRV records for a domain with the who.is DNS lookup tool. Because SRV records live at prefixed names rather than the bare domain, you'll query the specific service label — for example _sip._tcp.example.com — and read back the four fields: priority, weight, port, and target.
Use it to confirm the priorities and weights are what you intended, that the port is correct, and that the target is a real hostname with A/AAAA records rather than an IP or a CNAME. It's also worth checking the WHOIS and nameserver data to make sure you're editing DNS at the provider that's actually authoritative for the domain — otherwise your SRV changes won't take effect.
Key takeaways
- An SRV (Service) record advertises both the host and the port for a named service, so clients look up where to connect instead of assuming a fixed location.
- SRV records live at a prefixed name of the form _service._proto.name (e.g. _sip._tcp.example.com); the leading underscores are literal and prevent collisions with real hostnames.
- The four data fields are priority (lower is preferred), weight (load share among equal priorities), port (the TCP/UDP port), and target (a real hostname ending in a dot).
- A target of "." means the service is explicitly not available, and the target must have A/AAAA records — never an IP literal and never a CNAME.
- Unlike MX, which is mail-only and has no port, SRV is general-purpose and includes a port — used by SIP/VoIP, XMPP, LDAP, Active Directory, Minecraft, and more.
- SRV only works for protocols whose clients perform the lookup; ordinary web browsers ignore SRV for normal HTTP/HTTPS.
Look up a domain’s DNS records
Inspect SRV records and the full DNS configuration for any domain on who.is.
Frequently asked questions
What is an SRV record used for?▾
It tells clients where a particular network service lives — both the host and the port. Protocols like SIP/VoIP, XMPP chat, LDAP, Microsoft Active Directory, and Minecraft use SRV records so a client can discover the right server and port from DNS instead of assuming a fixed location.
What do priority and weight mean in an SRV record?▾
Priority sets which targets to prefer, and like MX preference a lower number wins — higher numbers act as backups. Weight only applies among targets that share the same priority: it sets the proportional share of connections each one receives, so weights of 60 and 40 split traffic roughly 60/40.
What does the _service._proto prefix mean?▾
SRV records are published at a structured name rather than the bare domain. _service is the symbolic service name (e.g. _sip), _proto is the transport (_tcp or _udp), and the rest is the domain — so SIP over TCP for example.com lives at _sip._tcp.example.com. The leading underscores are literal characters required by the spec; because underscores aren't valid in normal hostnames, they keep these labels from colliding with real hosts.
Can an SRV target be a CNAME or an IP?▾
Why doesn't my website use an SRV record?▾
Because web browsers don't look one up. Loading https://example.com resolves the domain's A/AAAA record and connects on the standard port — browsers never consult an SRV record for normal HTTP/HTTPS. SRV only works for protocols whose clients are designed to query it (SIP, XMPP, Active Directory, and so on); for the web you use A/AAAA and CNAME records instead.
How is an SRV record different from an MX record?▾
MX is mail-specific and has no port — inbound email always uses SMTP on port 25. SRV is general-purpose and includes a port, so the service can run anywhere. SRV also lives at a prefixed _service._proto.name label and adds a weight field for finer load-balancing. Both share the rule that the target must be a real hostname with address records — never an IP or a CNAME.