{"id":"dns-message-parse","version":"1.0.0","description":"Parse a DNS message hex string into the RFC 1035 header, questions, and resource records.","supported_operations":["parse dns message wire hex","decode rfc 1035 dns packet","read dns header questions and records","expand compressed names in a dns message","dns query packet hex to fields","structured fields from a dns message","פענוח הודעת די אן אס מקוד הקס"],"unsupported_operations":["resolve a dns name on the network","validate dnssec signatures or check AD and CD","decode A MX TXT or SOA rdata into fields","convert a name to punycode"],"semantics":["Input message_hex is lowercase even-length hexadecimal of one RFC 1035 message, with no TCP length prefix.","The header returns every RFC 1035 Section 4.1.1 field. QR, AA, TC, RD and RA are booleans. Opcode is an integer 0..15 and RCODE is an integer 0..15. Z is an integer 0..7 covering diagram columns 9 through 11; AD and CD are not separate fields, so flags 0x0070 yield z 7.","Questions and records keep unknown type and class codes. RDATA other than an OPT record is preserved as lowercase rdata_hex and is not interpreted.","An OPT record (type 41) is accepted only in the additional section, only with the root name, and at most once. Its CLASS, TTL and RDATA are also returned as udp_payload_size, extended RCODE, version, dnssec_ok (the DO bit), a 15-bit z, and option tuples. Unknown option codes are kept.","Compression pointers must target an earlier offset. A pointer cycle is compression_loop. The TC bit is preserved and does not by itself make a complete message invalid. Header counts must match the records present; leftover bytes are trailing_bytes.","Names are absolute. Parsing emits a canonical presentation: dot-separated labels, root as \".\", printable ASCII other than \".\" and \"\\\" as itself, and every other octet as a three-digit decimal escape. Letter case is preserved.","Caps are enforced before or during the walk: message bytes, total records, name octets, label octets, pointer hops, RDATA bytes and OPT options. A count above the record cap fails before the body is read.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_message_bytes":512,"max_hex_chars":1024,"max_records":32,"max_name_octets":255,"max_label_octets":63,"max_pointer_hops":16,"max_rdata_bytes":489,"max_opt_options":16},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"required":["message_hex"],"properties":{"message_hex":{"type":"string","minLength":0,"maxLength":1024,"pattern":"^([0-9a-f]{2})*$"}}},"output_schema":{"type":"object","additionalProperties":false,"required":["header","questions","answers","authority","additional"],"properties":{"header":{"type":"object","additionalProperties":false,"required":["id","qr","opcode","aa","tc","rd","ra","z","rcode","qdcount","ancount","nscount","arcount"],"properties":{"id":{"type":"integer","minimum":0,"maximum":65535},"qr":{"type":"boolean"},"opcode":{"type":"integer","minimum":0,"maximum":15},"aa":{"type":"boolean"},"tc":{"type":"boolean"},"rd":{"type":"boolean"},"ra":{"type":"boolean"},"z":{"type":"integer","minimum":0,"maximum":7},"rcode":{"type":"integer","minimum":0,"maximum":15},"qdcount":{"type":"integer","minimum":0,"maximum":32},"ancount":{"type":"integer","minimum":0,"maximum":32},"nscount":{"type":"integer","minimum":0,"maximum":32},"arcount":{"type":"integer","minimum":0,"maximum":32}}},"questions":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["name","type","class"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1024},"type":{"type":"integer","minimum":0,"maximum":65535},"class":{"type":"integer","minimum":0,"maximum":65535}}}},"answers":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["name","type","class","ttl","rdata_hex","opt"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1024},"type":{"type":"integer","minimum":0,"maximum":65535},"class":{"type":"integer","minimum":0,"maximum":65535},"ttl":{"type":"integer","minimum":0,"maximum":4294967295},"rdata_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"},"opt":{"oneOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["udp_payload_size","extended_rcode","version","dnssec_ok","z","options"],"properties":{"udp_payload_size":{"type":"integer","minimum":0,"maximum":65535},"extended_rcode":{"type":"integer","minimum":0,"maximum":255},"version":{"type":"integer","minimum":0,"maximum":255},"dnssec_ok":{"type":"boolean"},"z":{"type":"integer","minimum":0,"maximum":32767},"options":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["code","data_hex"],"properties":{"code":{"type":"integer","minimum":0,"maximum":65535},"data_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"}}}}}}]}}}},"authority":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["name","type","class","ttl","rdata_hex","opt"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1024},"type":{"type":"integer","minimum":0,"maximum":65535},"class":{"type":"integer","minimum":0,"maximum":65535},"ttl":{"type":"integer","minimum":0,"maximum":4294967295},"rdata_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"},"opt":{"oneOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["udp_payload_size","extended_rcode","version","dnssec_ok","z","options"],"properties":{"udp_payload_size":{"type":"integer","minimum":0,"maximum":65535},"extended_rcode":{"type":"integer","minimum":0,"maximum":255},"version":{"type":"integer","minimum":0,"maximum":255},"dnssec_ok":{"type":"boolean"},"z":{"type":"integer","minimum":0,"maximum":32767},"options":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["code","data_hex"],"properties":{"code":{"type":"integer","minimum":0,"maximum":65535},"data_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"}}}}}}]}}}},"additional":{"type":"array","maxItems":32,"items":{"type":"object","additionalProperties":false,"required":["name","type","class","ttl","rdata_hex","opt"],"properties":{"name":{"type":"string","minLength":1,"maxLength":1024},"type":{"type":"integer","minimum":0,"maximum":65535},"class":{"type":"integer","minimum":0,"maximum":65535},"ttl":{"type":"integer","minimum":0,"maximum":4294967295},"rdata_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"},"opt":{"oneOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["udp_payload_size","extended_rcode","version","dnssec_ok","z","options"],"properties":{"udp_payload_size":{"type":"integer","minimum":0,"maximum":65535},"extended_rcode":{"type":"integer","minimum":0,"maximum":255},"version":{"type":"integer","minimum":0,"maximum":255},"dnssec_ok":{"type":"boolean"},"z":{"type":"integer","minimum":0,"maximum":32767},"options":{"type":"array","maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["code","data_hex"],"properties":{"code":{"type":"integer","minimum":0,"maximum":65535},"data_hex":{"type":"string","minLength":0,"maxLength":978,"pattern":"^([0-9a-f]{2})*$"}}}}}}]}}}}}},"examples":[{"input":{"message_hex":"03e50800000000010000000000000100010000000000040a010034"},"output":{"header":{"id":997,"qr":false,"opcode":1,"aa":false,"tc":false,"rd":false,"ra":false,"z":0,"rcode":0,"qdcount":0,"ancount":1,"nscount":0,"arcount":0},"questions":[],"answers":[{"name":".","type":1,"class":1,"ttl":0,"rdata_hex":"0a010034","opt":null}],"authority":[],"additional":[]}},{"input":{"message_hex":"0000000000000000000000010000290200000080000000"},"output":{"header":{"id":0,"qr":false,"opcode":0,"aa":false,"tc":false,"rd":false,"ra":false,"z":0,"rcode":0,"qdcount":0,"ancount":0,"nscount":0,"arcount":1},"questions":[],"answers":[],"authority":[],"additional":[{"name":".","type":41,"class":512,"ttl":32768,"rdata_hex":"","opt":{"udp_payload_size":512,"extended_rcode":0,"version":0,"dnssec_ok":true,"z":0,"options":[]}}]}},{"input":{"message_hex":"0000007000010000000000000000010001"},"output":{"header":{"id":0,"qr":false,"opcode":0,"aa":false,"tc":false,"rd":false,"ra":false,"z":7,"rcode":0,"qdcount":1,"ancount":0,"nscount":0,"arcount":0},"questions":[{"name":".","type":1,"class":1}],"answers":[],"authority":[],"additional":[]}}],"execute_url":"/v1/tools/dns-message-parse/versions/1.0.0/execute"}