SRV record generator: how do you build a DNS SRV record?
How does this check work, and what does the result tell you?
AdminKit's SRV record generator builds an RFC 2782 SRV record from the service, protocol, domain, priority, weight, port, target and TTL you enter, and shows both the zone-file line and the name/value split DNS panels ask for. It runs entirely in your browser: nothing is sent to any server.
Part of the DNS cluster — more tools, guides and terms on dns.
Any service label, e.g. _sip, _xmpp-client, _autodiscover. A missing leading "_" is added.
The domain the service belongs to.
Host name that runs the service, or "." if the service is not available at this domain.
Lower is tried first.
Share among targets with the same priority; 0 if there is nothing to balance.
Built entirely in your browser — nothing you type is sent to AdminKit or any other server, and this tool does no DNS lookup.
Building the record changes nothing by itself: publish it at your DNS host, then verify it with a DNS lookup for the SRV type, for example with dig or nslookup.
What the result means
The zone-file line is the complete SRV record; the name and value fields are the same record split the way most DNS hosting panels ask for it. A target of "." publishes that the service is not available at this domain.
Next step
Publish the record at your DNS host, then verify it with a DNS lookup for the SRV type, for example with dig or nslookup. For the plain-language definition, see the SRV record glossary entry.
Keep this result
Copy a link to this check so you can share it or run it again later. Want a heads-up when this result changes? Talk to our team and we'll set it up for you.
How it works and limits
Fill in the service, protocol, domain, priority, weight, port, target and TTL below, and this tool assembles the SRV
record as you type, entirely in your browser — nothing you enter is sent to AdminKit or any other server, and no DNS
query is made. It shows the record two ways: as one zone-file line, and split into the name and value boxes most DNS
hosting panels ask for. Building the record changes nothing by itself: publish it at your DNS host, then verify it
with a DNS lookup for the SRV type. AdminKit’s own DNS lookup does not query SRV records, so
use a tool such as dig or nslookup for that step.
What is an SRV record for?
An SRV record tells a client which host and port run a given service for a domain, so the client does not have to
guess a fixed host name or port. RFC 2782 defines the format: the record
lives at a name made of an underscore-prefixed service label, an underscore-prefixed protocol label and the domain,
and its data is a priority, a weight, a port and a target host. Clients such as SIP phones, XMPP chat apps and mail
programs look these names up to find where to connect. Microsoft’s
Autodiscover for Exchange
guide, for example, lists a DNS query for an SRV record named _autodiscover._tcp. plus the domain as the last
step a client tries when the other Autodiscover endpoints fail. Active Directory relies on SRV records too:
Microsoft’s guide to
verifying that SRV DNS records have been created
checks a domain controller’s _ldap._tcp record with tools such as nslookup.
The record format RFC 2782 gives is:
_Service._Proto.Name TTL Class SRV Priority Weight Port Target
What does each field mean?
- Service — the symbolic name of the service, such as
_sip,_xmpp-clientor_autodiscover. RFC 2782 prepends the underscore so these labels cannot collide with ordinary host names. - Protocol — usually
_tcpor_udp, which RFC 2782 calls the most useful values; any protocol name may be used, and this tool also offers_tlsfor setups that ask for it. - Domain — the domain the service belongs to. The record is published at the service and protocol labels in front of it, not at the domain itself.
- Priority — 0 to 65535. A client must try the reachable target with the lowest number first.
- Weight — 0 to 65535. Among targets with the same priority, a larger weight gets a proportionately higher chance of being picked; use 0 when there is nothing to balance.
- Port — 0 to 65535, the port the service listens on at the target.
- Target — the host name that runs the service. It must have address records and must not be an alias (a
CNAME). A target of
.means the service is decidedly not available at this domain. - TTL — how many seconds resolvers may cache the record.
How do DNS panels want the record split?
Most DNS hosting panels do not take a zone-file line. They ask for a name (or host) and a value, and some ask for
priority, weight, port and target in separate boxes. Cloudflare’s
DNS record types reference
shows an SRV record created with the name _xmpp._tcp.example.com and a data object holding priority, weight, port
and target as separate fields, and its API response returns priority on its own beside a content string of weight,
port and target. Google Cloud’s
Cloud DNS record types overview describes SRV data as a single
string of priority, weight, port and host, such as 0 1 587 mail.example.com. This tool gives you every form:
- Name / Host (relative) —
_sip._tcp, for panels that add the domain for you. - Name / Host (fully qualified) —
_sip._tcp.example.com., for panels that want the whole name. - Value — priority, weight, port and target in one string.
- Value when priority has its own field — weight, port and target only.
Some panels add the trailing dot to the target themselves and some expect you to type it; if a saved record shows a doubled dot or your domain appended to the target, remove the trailing dot and save again.
How to read the results
The output updates as you type, starting from a filled-in SIP example.
- Zone-file line — the full record for a BIND-style zone file. For the default example it is:
_sip._tcp.example.com. 3600 IN SRV 10 60 5060 sip.example.com.
- Copy buttons copy each form to the clipboard.
- Warnings (amber) — the record is still built, but something looks odd: a
.target with a non-zero priority, weight or port, or port 0 on a real target. - Errors (red, no output) — a field is missing or invalid. Priority, weight and port outside 0–65535, a TTL outside 0–2147483647, a non-numeric value, an invalid domain, or an IP address in Target are all rejected.
- Missing underscores are added — typing
sipandtcpgives_sip._tcp; labels are lowercased. A service or protocol with a dot, a space, two leading underscores, or a hyphen at either end is rejected.
Examples
A service that is not offered at a domain, in the style of RFC 6186’s mail-client example:
_imap._tcp.example.com. 3600 IN SRV 0 0 0 .
An XMPP client record with two servers at the same priority, sharing load 3 to 1:
_xmpp-client._tcp.example.com. 3600 IN SRV 5 30 5222 xmpp1.example.com.
_xmpp-client._tcp.example.com. 3600 IN SRV 5 10 5222 xmpp2.example.com.
Build each line separately here and publish both under the same name. If you run SIP on port 5060, AdminKit’s guide on whether port 5060 SIP is exposed covers what that port shows to the internet.
Limits
- This tool only builds text. It never queries DNS and never publishes anything, so it cannot tell you whether the record exists, whether the target resolves, or whether the target is a CNAME.
- It builds one record at a time. For several targets, build each one and publish them under the same name.
- It does not check that the service and protocol names are registered or match what your software expects; use the names your software’s documentation gives.
Reference: SRV record for the plain-language definition. This tool is part of AdminKit’s DNS cluster, next to the CAA record generator and the PTR record generator.
Frequently asked questions
Does this tool send what I type to AdminKit or anywhere else?
No. Every field is read by your browser and the record is built there with plain JavaScript; nothing you type is sent to AdminKit or any other server, and the tool does no DNS lookup. That also means it cannot see what your domain publishes today.
What does a target of "." mean?
RFC 2782 says a target of "." means the service is decidedly not available at this domain. Clients that find such a record should not try to connect for that service. RFC 6186's mail-client example publishes these records with priority, weight and port all set to 0, for example _imap._tcp SRV 0 0 0 .
What if I type sip instead of _sip, or tcp instead of _tcp?
The tool adds the missing leading underscore for you and lowercases the label, so sip becomes _sip and TCP becomes _tcp. A label with a dot, a space, two leading underscores, or a hyphen at either end is rejected with an error instead of being guessed at.
How do priority and weight work together?
A client must try the target with the lowest priority number it can reach first. Among targets that share the same priority, weight sets a relative share: larger weights get a proportionately higher chance of being picked. RFC 2782 asks administrators to use weight 0 when there is no server selection to do.
Can the target be an IP address or a CNAME?
No. RFC 2782 requires the target to be a domain name with one or more address records, and that name must not be an alias. This tool rejects an IP address in the Target field; it cannot check whether a host name you enter is a CNAME, because it does no DNS lookup.