Read the endpoint fields
02SRV record data contains three unsigned 16-bit numbers followed by a DNS target name. Priority, weight and port answer different questions.
Three length-prefixed labels plus root zero occupy 15 octets. Total RDATA is 21 octets, not a six-byte fixed record.
Source for this drawing: RFC 2782 · Read RFC source: SRV format · Priority, Weight, Port, Target ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Priority chooses a tier, weight orders peers within a tier, and port names the destination endpoint.
- The textual owner/TTL/class/type precede SRV RDATA. RDATA itself is Priority(16 bits), Weight(16), Port(16), then Target encoded as a DNS name (format, pages 3–4). All three numbers range from 0 through 65535 and use network byte order, most significant byte first.
- Priority is a preference tier: a client MUST attempt the lowest-numbered priority it can reach. Within one priority, hosts SHOULD be tried in an order defined by Weight. Weight is not a way to override a lower-numbered priority.
- Weight is a relative selection input among entries with the same priority. Larger weights SHOULD have proportionately higher selection probability. Administrators SHOULD use zero when there is no selection to do. Port is the service’s actual port on that target, which need not be the conventional assigned port.
- Chosen RDATA: priority 10, weight 3, port 9, target a.example.com. The first bytes are 00 0A 00 03 00 09. The uncompressed target name uses label lengths 01,07,03, then a root zero, totaling 15 octets; RDATA totals 6+15=21 octets. This is a fictional service endpoint, not a claim that TCP port 9 is a registered foobar service.
- Target MUST have one or more address records and MUST NOT be an alias. RFC 2782 says name compression is not to be used in Target unless permitted by future standards action (page 4). This guide encodes the uncompressed case; it does not silently replace the name with a DNS compression pointer.
- The geometry here scales to RDATA octet counts: three 2-octet fields followed by a 15-octet name. The name’s displayed dotted form is a reading aid, not its wire encoding or a guarantee of server identity.
Example values 10/3/9 are chosen. One octet is eight bits. Only RDATA is drawn; owner, TTL, class, type, RDLENGTH and the surrounding DNS message are outside this field diagram.
Read the RFC section ↗