Service-aware clients need more than a host address when an application can run on several servers or a non-default port. An SRV lookup exposes the DNS route for one named service and transport so an operator can compare the published destinations with the application's intended discovery settings.

The queried owner combines underscored service and protocol labels with the domain, such as _xmpp-server._tcp.example.net. Each answer row then lists priority, weight, port, and target after the SRV type; lower priority values are preferred, while weight affects selection only among records sharing one priority.

Every SRV target should be a canonical hostname with direct A or AAAA records. Those address records complete the DNS discovery path, but they do not prove that the target accepts connections, negotiates the application protocol, or presents the expected TLS certificate.

Steps to check SRV records with dig:

  1. Query the exact service and protocol owner on the selected DNS server.
    $ dig @ns1.example.net _xmpp-server._tcp.example.net SRV +noall +answer
    _xmpp-server._tcp.example.net. 300 IN SRV 10 60 5269 chat-a.example.net.
    _xmpp-server._tcp.example.net. 300 IN SRV 10 40 5269 chat-b.example.net.
    _xmpp-server._tcp.example.net. 300 IN SRV 20 0 5269 chat-c.example.net.

    The example uses the XMPP server service, TCP transport, example.net domain, and ns1.example.net server. SRV owner labels keep their leading underscores.

  2. Read each SRV answer row from left to right.

    The fields after SRV are priority, weight, port, and target. The earlier fields are owner name, TTL in seconds, class, and record type.

  3. Identify the target group with the lowest numeric priority.

    The two priority-10 targets are preferred over the priority-20 target. A client moves to priority 20 only when it cannot use a target at priority 10.

  4. Compare weights only among records with the same priority.

    The weights 60 and 40 express relative selection chances inside the priority-10 group; they do not make either target outrank a record at a lower priority.

  5. Validate each published endpoint against the intended service route.

    All three records direct XMPP server traffic to port 5269 on the listed target hostname. A target of . means the service is explicitly unavailable at this owner.

  6. Resolve every SRV target to direct address records.
    $ dig +noall +answer @ns1.example.net chat-a.example.net A chat-b.example.net A chat-c.example.net A
    chat-a.example.net. 300 IN A 192.0.2.21
    chat-b.example.net. 300 IN A 192.0.2.22
    chat-c.example.net. 300 IN A 192.0.2.23

    Each target returns a direct A record, so the DNS discovery chain reaches an address for every published route. An IPv6 service also needs direct AAAA records; an empty result or a CNAME at the target fails this check.