DNS Name Longest Common Suffix

Find the longest complete DNS label suffix shared by two names under ASCII case-insensitive comparison, preserving the left name’s original octets.

Description

Find the longest complete DNS label suffix shared by two names under ASCII case-insensitive comparison, preserving the left name’s original octets.

DNS suffix comparison is based on whole labels rather than arbitrary text endings. This operation finds the shared rightmost label sequence.

When to use this tool

Find the longest complete DNS label suffix shared by two names under ASCII case-insensitive comparison, preserving the left name’s original octets.

  • Prepare the supplied leftJson, rightJson 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

  1. Enter leftJson, rightJson. Use the exact text syntax, units and index conventions explained below.
  2. Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
  3. Read result.labels, result.count. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.

Parse both JSON inputs as lists of nonempty byte labels. Compare labels from the right with ASCII case-insensitive octet equality, count matches and return the matching suffix from the left input.1

Input fieldMeaning and representationAccepted input
leftJsonJSON text, entered as one text field. The decoded structure is illustrated below; it is not a separate file.Text
rightJsonJSON 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.

json
[
  {
    "field": "leftJson",
    "decoded": [
      [
        97
      ],
      [
        98
      ],
      [
        99
      ]
    ]
  },
  {
    "field": "rightJson",
    "decoded": [
      [
        100
      ],
      [
        66
      ],
      [
        99
      ]
    ]
  }
]
Output fieldInterpretation
resultObject containing the named outputs below.
result.labelsThe labels list in the ordering and representation described above.
result.countThe count value under the stated formula or text convention.
json
{
  "input": {
    "leftJson": "[[97],[98],[99]]",
    "rightJson": "[[100],[66],[99]]"
  },
  "output": {
    "result": {
      "labels": [
        [
          98
        ],
        [
          99
        ]
      ],
      "count": 2
    }
  }
}

Limitations and assumptions

  • Original left-side octets are preserved. No Unicode folding, public-suffix policy, DNS query or zone delegation inference is applied.
  • 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

  1. Tool behavior and example: DNS Name Longest Common Suffix — tool.io

Similar or alternative tools

  • DNS Name Suffix Label Match

    Check DNS suffix membership by complete labels with ASCII case-insensitive octet comparison; avoids misleading textual substring suffix matches.

  • DNS Name Absolute from Relative

    Append explicit relative DNS label octets to a zone’s labels with complete-name byte-budget validation; no resolver, search-list or origin guessing.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies