DNS Label List Wire Formatter
Format uncompressed DNS wire labels from explicit octets with 63-byte label and 255-byte protocol whole-name bounds, plus a 128-byte local output budget; appends root zero, no compression or IDNA.
Description
Format uncompressed DNS wire labels from explicit octets with 63-byte label and 255-byte protocol whole-name bounds, plus a 128-byte local output budget; appends root zero, no compression or IDNA.
An uncompressed DNS wire name carries each label's length and a final zero byte. Its protocol budget and this tool's local budget differ.
When to use this tool
Format uncompressed DNS wire labels from explicit octets with 63-byte label and 255-byte protocol whole-name bounds, plus a 128-byte local output budget; appends root zero, no compression or IDNA.
- Prepare the supplied labelsJson fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter labelsJson. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.bytes. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Parse labelsJson as nonempty byte labels, enforcing 63 bytes per label and 255 bytes for the complete name. Emit each length and label, append zero and additionally reject output longer than 128 bytes.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| labelsJson | JSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file. | Text |
For the JSON text fields, the following decoded structures show the example records before they are serialized into input strings. Keep field names, list nesting and value types as shown.
[
{
"field": "labelsJson",
"decoded": [
[
97
],
[
98,
99
]
]
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.bytes | The bytes list in the ordering and representation described above. |
{
"input": {
"labelsJson": "[[97],[98,99]]"
},
"output": {
"result": {
"bytes": [
1,
97,
2,
98,
99,
0
]
}
}
} Limitations and assumptions
- An empty list formats the root as [0]. No compression, Unicode conversion or DNS packet framing is added.
- All declared input fields are required and unexpected top-level fields are rejected. Numbers must be finite; lists are limited to 128 entries and ordinary text fields to 8,192 UTF-16 code units, with tighter limits where stated.
- JSON text inputs must parse within bounded nesting and size limits. Numeric outputs outside the safe finite range are rejected; large exact integer results use decimal strings. Indexes and half-open spans are zero-based unless a rank is explicitly described as one-based.
Alternative or Complementary methods
Use a packet-aware DNS parser or resolver when the task requires compression-chain validation, live records or complete resource-record semantics. Keep byte labels, presentation text and network packets distinct.
References
Similar or alternative tools
- DNS TXT String Wire Formatter
Format a nonempty DNS TXT character-string list as length-prefixed octets without a terminator; total output is bounded to 128 bytes and strings are not text-decoded.
- DNS Compression Pointer Offset Formatter
Format an explicit 14-bit packet offset as a DNS compression pointer token; does not verify packet layout or target labels.