{"id":"dns-rdata-encode","version":"1.0.0","description":"Encode DNS RDATA for A, AAAA, NS, CNAME, PTR, MX, TXT, SOA, SRV, or unknown hex.","supported_operations":["encode dns rdata wire","dns record fields to rdata hex","build wire for dns a aaaa mx txt soa srv","dns presentation to uncompressed rdata","encode a dns resource record rdata","turn dns record data into octets","קידוד נתוני רשומת דיאן אס"],"unsupported_operations":["query DNS or resolve a hostname","compress a domain name against a DNS message","split a TXT string longer than 255 octets into chunks","validate DNSSEC signatures"],"semantics":["Structured rr_type is one of A, AAAA, NS, CNAME, PTR, MX, TXT, SOA, SRV. rr_class is a pinned mnemonic (IN, CS, CH, HS, NONE, ANY, or *). ANY is an alias of *.","Domain names are absolute, end with an unescaped dot, and are encoded uncompressed. Each label is at most 63 octets. The whole name, including length octets and the root, is at most 255 octets (RFC 1035 sections 2.3.4 and 3.1). A longer name is invalid_input, including when it follows MX or SRV fixed fields.","A is canonical dotted-decimal IPv4 with no leading zeros. AAAA accepts RFC 4291 text (one :: and an optional final dotted IPv4 tail, no zone id) and the wire is 16 octets.","TXT chunks are printable ASCII octet strings, with \\\\ , \\. and \\DDD escapes. Each chunk is 0 to 255 octets and at least one chunk is required. Chunks are not auto-split.","MX preference and SRV priority, weight and port are integers 0 to 65535. SOA serial, refresh, retry, expire and minimum are integers 0 to 4294967295. All multi-byte integers are big-endian.","An unknown rr_type_code (not one of the nine structured types) copies lowercase rdata_hex through unchanged. A structured type code in that form is invalid_input.","Class is recorded with its pinned code and does not alter RDATA octets. No DNS query is sent.","More than 262144 UTF-8 bytes of JSON input, more than 65535 RDATA octets, more than 4096 TXT chunks, or a name or chunk above its character cap is limit_exceeded before the rest of the parse.","Disclaimer: format transform only; provides no confidentiality, integrity, or authenticity."],"limits":{"max_input_bytes":262144,"max_rdata_bytes":65535,"max_txt_chunks":4096,"max_domain_chars":2048,"max_txt_chunk_chars":2048},"pricing":{"status":"unpriced","charge_usd":null},"input_schema":{"type":"object","additionalProperties":false,"properties":{"rr_type":{"type":"string","enum":["A","AAAA","NS","CNAME","PTR","MX","TXT","SOA","SRV"]},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"rr_type_code":{"type":"integer","minimum":0,"maximum":65535},"ipv4":{"type":"string","minLength":7,"maxLength":15},"ipv6":{"type":"string","minLength":2,"maxLength":45},"domain_name":{"type":"string","minLength":1,"maxLength":2048},"preference":{"type":"integer","minimum":0,"maximum":65535},"exchange":{"type":"string","minLength":1,"maxLength":2048},"txt_chunks":{"type":"array","minItems":1,"maxItems":4096,"items":{"type":"string","minLength":0,"maxLength":2048}},"mname":{"type":"string","minLength":1,"maxLength":2048},"rname":{"type":"string","minLength":1,"maxLength":2048},"serial":{"type":"integer","minimum":0,"maximum":4294967295},"refresh":{"type":"integer","minimum":0,"maximum":4294967295},"retry":{"type":"integer","minimum":0,"maximum":4294967295},"expire":{"type":"integer","minimum":0,"maximum":4294967295},"minimum":{"type":"integer","minimum":0,"maximum":4294967295},"priority":{"type":"integer","minimum":0,"maximum":65535},"weight":{"type":"integer","minimum":0,"maximum":65535},"port":{"type":"integer","minimum":0,"maximum":65535},"target":{"type":"string","minLength":1,"maxLength":2048},"rdata_hex":{"type":"string","minLength":0,"maxLength":131070,"pattern":"^([0-9a-f]{2})*$"}},"oneOf":[{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","ipv4"],"properties":{"rr_type":{"const":"A"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"ipv4":{"type":"string","minLength":7,"maxLength":15}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","ipv6"],"properties":{"rr_type":{"const":"AAAA"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"ipv6":{"type":"string","minLength":2,"maxLength":45}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","domain_name"],"properties":{"rr_type":{"const":"NS"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"domain_name":{"type":"string","minLength":1,"maxLength":2048}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","domain_name"],"properties":{"rr_type":{"const":"CNAME"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"domain_name":{"type":"string","minLength":1,"maxLength":2048}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","domain_name"],"properties":{"rr_type":{"const":"PTR"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"domain_name":{"type":"string","minLength":1,"maxLength":2048}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","preference","exchange"],"properties":{"rr_type":{"const":"MX"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"preference":{"type":"integer","minimum":0,"maximum":65535},"exchange":{"type":"string","minLength":1,"maxLength":2048}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","txt_chunks"],"properties":{"rr_type":{"const":"TXT"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"txt_chunks":{"type":"array","minItems":1,"maxItems":4096,"items":{"type":"string","minLength":0,"maxLength":2048}}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","mname","rname","serial","refresh","retry","expire","minimum"],"properties":{"rr_type":{"const":"SOA"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"mname":{"type":"string","minLength":1,"maxLength":2048},"rname":{"type":"string","minLength":1,"maxLength":2048},"serial":{"type":"integer","minimum":0,"maximum":4294967295},"refresh":{"type":"integer","minimum":0,"maximum":4294967295},"retry":{"type":"integer","minimum":0,"maximum":4294967295},"expire":{"type":"integer","minimum":0,"maximum":4294967295},"minimum":{"type":"integer","minimum":0,"maximum":4294967295}}},{"type":"object","additionalProperties":false,"required":["rr_type","rr_class","priority","weight","port","target"],"properties":{"rr_type":{"const":"SRV"},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"priority":{"type":"integer","minimum":0,"maximum":65535},"weight":{"type":"integer","minimum":0,"maximum":65535},"port":{"type":"integer","minimum":0,"maximum":65535},"target":{"type":"string","minLength":1,"maxLength":2048}}},{"type":"object","additionalProperties":false,"required":["rr_type_code","rr_class","rdata_hex"],"properties":{"rr_type_code":{"type":"integer","minimum":0,"maximum":65535},"rr_class":{"type":"string","enum":["IN","CS","CH","HS","NONE","ANY","*"]},"rdata_hex":{"type":"string","minLength":0,"maxLength":131070,"pattern":"^([0-9a-f]{2})*$"}}}]},"output_schema":{"type":"object","additionalProperties":false,"required":["data_version","rr_type","rr_type_code","rr_class","rr_class_code","wire_known","rdata_length","rdata_hex"],"properties":{"data_version":{"type":"string","const":"iana-dns-parameters-2026-10-21"},"rr_type":{"type":["string","null"],"minLength":1,"maxLength":12},"rr_type_code":{"type":"integer","minimum":0,"maximum":65535},"rr_class":{"type":"string","minLength":1,"maxLength":4},"rr_class_code":{"type":"integer","minimum":0,"maximum":65535},"wire_known":{"type":"boolean"},"rdata_length":{"type":"integer","minimum":0,"maximum":65535},"rdata_hex":{"type":"string","minLength":0,"maxLength":131070,"pattern":"^([0-9a-f]{2})*$"}}},"examples":[{"input":{"rr_type":"A","rr_class":"IN","ipv4":"192.0.2.1"},"output":{"data_version":"iana-dns-parameters-2026-10-21","rr_type":"A","rr_type_code":1,"rr_class":"IN","rr_class_code":1,"wire_known":true,"rdata_length":4,"rdata_hex":"c0000201"}},{"input":{"rr_type":"TXT","rr_class":"CH","txt_chunks":["hi"]},"output":{"data_version":"iana-dns-parameters-2026-10-21","rr_type":"TXT","rr_type_code":16,"rr_class":"CH","rr_class_code":3,"wire_known":true,"rdata_length":3,"rdata_hex":"026869"}}],"execute_url":"/v1/tools/dns-rdata-encode/versions/1.0.0/execute"}