{"id":"dns-message-encode","version":"1.0.0","description":"Encode a structured DNS message to canonical uncompressed RFC 1035 wire hex.","supported_operations":["encode dns message to wire hex","build an rfc 1035 dns packet","serialize dns questions and resource records","format a dns query as uncompressed bytes","dns message fields to lowercase hex","write a dns message without name pointers","קידוד הודעת די אן אס לקוד הקס"],"unsupported_operations":["compress domain names with pointers","send the dns packet or choose a resolver","sign a dnssec record","add a tcp length prefix"],"semantics":["Names are encoded uncompressed. RFC 1035 Section 4.1.4 allows a sender to omit pointers. Parsing that output returns the same header, questions and records.","Header z is an integer 0..7 and is written into diagram columns 9 through 11. A non-zero z is preserved. Opcode and RCODE are integers, not names.","header.qdcount, ancount, nscount and arcount must equal the matching array lengths. A mismatch is count_mismatch. Arrays or counts above the record cap fail before records are encoded.","Presentation names are absolute and have no trailing dot except the root \".\". \"\\.\", \"\\\\\" and \"\\DDD\" (exactly three digits) are accepted. Output of a later parse uses only the canonical escapes.","A type 41 record is allowed only in additional, only once, and its opt object must describe the same CLASS, TTL and RDATA. Other RDATA is copied from lowercase rdata_hex with no type-specific layout check.","The result is lowercase hex and the byte count. The encoded message is rejected when it would pass the message byte cap.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_message_bytes":512,"max_records":32,"max_name_octets":255,"max_label_octets":63,"max_name_chars":1024,"max_rdata_bytes":489,"max_opt_options":16},"pricing":{"status":"unpriced","charge_usd":null},"input_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})*$"}}}}}}]}}}}}},"output_schema":{"type":"object","additionalProperties":false,"required":["message_hex","message_bytes"],"properties":{"message_hex":{"type":"string","minLength":0,"maxLength":1024,"pattern":"^([0-9a-f]{2})*$"},"message_bytes":{"type":"integer","minimum":12,"maximum":512}}},"examples":[{"input":{"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":[]},"output":{"message_hex":"03e50800000000010000000000000100010000000000040a010034","message_bytes":27}},{"input":{"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":[]},"output":{"message_hex":"0000007000010000000000000000010001","message_bytes":17}},{"input":{"header":{"id":0,"qr":false,"opcode":0,"aa":false,"tc":false,"rd":false,"ra":false,"z":0,"rcode":0,"qdcount":1,"ancount":0,"nscount":0,"arcount":0},"questions":[{"name":"ISI.EDU","type":1,"class":1}],"answers":[],"authority":[],"additional":[]},"output":{"message_hex":"00000000000100000000000003495349034544550000010001","message_bytes":25}}],"execute_url":"/v1/tools/dns-message-encode/versions/1.0.0/execute"}