DNS MX Preference Tie Groups
Group explicit DNS MX records by ascending unsigned preference, retaining equal-preference alternatives and indexes; no resolver ordering, target validation or mail delivery claim.
Description
Group explicit DNS MX records by ascending unsigned preference, retaining equal-preference alternatives and indexes; no resolver ordering, target validation or mail delivery claim.
MX preference ties identify equally preferred mail-exchanger observations. Keeping their indexes preserves the input evidence without choosing a destination.
When to use this tool
Group explicit DNS MX records by ascending unsigned preference, retaining equal-preference alternatives and indexes; no resolver ordering, target validation or mail delivery claim.
- Prepare the supplied recordsJson 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 recordsJson. 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.groups. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Parse recordsJson as preference/exchange objects, with integer preference from 0 to 65,535. Group by preference, sort groups ascending and retain source indexes and exchange strings in input order.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| recordsJson | 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": "recordsJson",
"decoded": [
{
"preference": 20,
"exchange": "b"
},
{
"preference": 10,
"exchange": "a"
},
{
"preference": 10,
"exchange": "c"
}
]
}
] | Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.groups | The groups list in the ordering and representation described above. |
{
"input": {
"recordsJson": "[{\"preference\":20,\"exchange\":\"b\"},{\"preference\":10,\"exchange\":\"a\"},{\"preference\":10,\"exchange\":\"c\"}]"
},
"output": {
"result": {
"groups": [
{
"preference": 10,
"indexes": [
1,
2
],
"exchanges": [
"a",
"c"
]
},
{
"preference": 20,
"indexes": [
0
],
"exchanges": [
"b"
]
}
]
}
}
} Limitations and assumptions
- No DNS query, address resolution or mail delivery occurs. Equal-preference records are not randomized or resolved into a final connection order.
- 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 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.
- DNS Compression Pointer Offset Parser
Parse exactly one two-byte DNS compression pointer into its 14-bit packet offset; does not dereference the pointer.