Publish an SRV record using the service's priority, weight and port

An SRV record tells compatible clients which host and port provide a named service. Its service label, protocol, priority, weight, port and target must match the application's specification. Adding an SRV record does not open a firewall port or make ordinary web browsers use it.

Check access and requirements

Obtain the exact record details from the service provider. Confirm the target hostname has usable address records and that the destination service is listening. Record existing SRV entries because several entries can form one intended service configuration.

01 Publish an SRV record using the service's priority, weight and port

  1. Identify the full owner name, commonly _service._protocol.example.com. If the DNS form separates Service and Protocol, use those fields rather than entering a duplicated combined name.
  2. Enter the supplied priority, weight and port in their proper fields. Lower priority values are preferred; weight distributes selection among eligible targets with the same priority.
  3. Use the target hostname specified by the service. It should resolve to addresses and must not be a CNAME alias under the SRV specification.
  4. Keep unrelated records and other intentional SRV targets. Add a replacement record only after checking whether the provider expects one target or a complete multi-target set.
  5. Save, then query the full underscored owner name for SRV. Check how the editor handles a final dot on fully qualified hostnames so it does not append the zone twice.

02 Read-only diagnostic example

Command example
dig _service._tcp.example.com SRV +noall +answer

Replace example names and documentation addresses with the exact authorised service details. These commands query existing configuration; they do not change DNS.

03 Example: map SRV fields to a provider instruction

An SRV record contains a service name, protocol, priority, weight, port and target. This fictional SIP example demonstrates the field order. Use it only as a mapping aid; obtain the actual values and service label from the service you are configuring.

Code or configuration example
_sip._tcp.example.com.  3600  IN  SRV  10 60 5060 sip.example.com.
sip.example.com.        3600  IN  A    192.0.2.40

Read the result: Here 10 is priority, 60 is weight and 5060 is the connection port. Lower priority values are preferred; weight influences selection among records at the same priority. The target hostname needs usable address records and should not be a CNAME alias.

In a form-based DNS editor, enter each number into its corresponding field instead of pasting the whole line into Target. Verify the published SRV answer and test a client that supports the service's SRV discovery. An SRV record cannot make unsupported client software discover the service.

Verify the authoritative DNS result

Confirm priority, weight, port and target from the authoritative answer. Test with a client that supports this service's SRV discovery, then verify an actual connection to the chosen endpoint.

Resolve setup problems

If the record exists but the client ignores it, check that the application supports SRV for that service and uses the exact label. If it chooses the right host but cannot connect, investigate service availability and network access.

A common question

Can I use SRV to make https://example.com automatically use an arbitrary web-server port?

Ordinary HTTPS navigation does not generally use an arbitrary SRV record that you invent. Follow the web platform's supported reverse-proxy, port or HTTPS-record configuration instead. SRV works when the client protocol explicitly supports its discovery rules.

  • 0 Users Found This Useful
  • domains-dns
Was this answer helpful?

Related Articles

Diagnose a website that fails only over IPv6 after an AAAA change

An incorrect AAAA record can send IPv6-capable visitors to an unavailable server while IPv4...

Delegate certificate DNS validation without exposing the main zone credential

DNS-01 certificate validation proves control through a TXT record at an _acme-challenge name. A...

Point an apex domain at a hosted service without an invalid CNAME

The apex is the domain itself, such as example.com. An ordinary CNAME cannot coexist there with...

Use CAA records to authorise the certificate authorities your services need

CAA records let a domain operator express which certificate authorities may issue certificates...

Delegate a subdomain to another authoritative DNS provider

Delegating a subdomain lets another DNS service manage a branch such as shop.example.com while...