DNS-S Messages

Introduction

The DnsServerApp uses DNS-S-… messages to communicate with other applications (such as the LogicApp) to handle inbound DNS (including ENUM) requests received from an external DNS/ENUM Client.

The following LuaApp services from the core n2svcd module handle messages from DnsServerApp.

The internal DNS-S-… messages are:

Note that this page uses the term “on-the-wire” to refer to the sending or receiving of ENUM content by the DnsServerApp. This term is also inclusive of the case where the message is sent by local loopback and does not physically transit a Network Interface Controller (NIC).

DNS-S-REQUEST

The DNS-S-REQUEST message is sent by DnsServerApp to the application that is configured for handling of inbound DNS/ENUM requests.

Refer to the DnsServerApp Configuration documentation for more information on setting default parameters.

The attributes of the DNS-S-REQUEST message are:

Attribute Type Description
dns Object Container for the parameters of the DNS/ENUM request that we have received.
.remote_ip String The remote dot-notation IP address from which the DNS/ENUM request was sent.
.remote_port Integer The remote UDP or TCP port from which the DNS/ENUM request was sent.
.transaction_id 0 - 65535 The two-byte transaction ID as an integer value.
.flags Integer An integer representation of the top-level DNS message two-byte flags field.
.opcode Integer An integer representation of the 4-bit opcode value from the flags field.
.recursion_desired 0 / 1 An integer representation of the 1-bit RD value from the flags field.
.checking_disabled 0 / 1 An integer representation of the 1-bit CD value from the flags field.
.num_questions Integer The number of entries contained in the questions section of the DNS/ENUM request.
For a standard query with opcode = 0, at least one question should be present.
.num_answers Integer The number of entries contained in the answers section of the DNS/ENUM request.
For an inverse query with opcode = 1, at least one answer should be present.
.num_authorities Integer The number of entries contained in the authorities section of the DNS/ENUM request.
This should be zero in any normal scenario for both standard query or inverse query.
.num_additional Integer The number of entries contained in the additional section of the DNS/ENUM request.
This should be zero in any normal scenario for both standard query or inverse query.
.queries Array of Object The list of Query records parsed from the DNS Request (see below for object structure).
.authorities Array of Object The list of Authority response records parsed from the DNS Request (see below for object structure).
.additional Array of Object The list of Additional response records parsed from the DNS Request (see below for object structure).
.answers Array of Object The list of Answer response records parsed from the DNS Request (see below for object structure).

The queries Object in the dns Object for DNS-S-REQUEST has the following structure.

Field Type Description
.name String [Required] The name of the record as a dot-notation string.
.type Integer [Required] The integer value of the Type, e.g. 35 indicating NAPTR.
.class Integer [Required] The integer value of the Class, e.g. 1 indicating IN.
.e164_digits String If the name appears to be an E.164 digit string, then the decoded (non-dot-notation) ASCII address string equivalent E.164 address will be decoded and provided here. It will not be given a '+' prefix.

The answers, authorities, and additional Objects in the dns Object for DNS-S-REQUEST have the following structure.

Note that in normal processing, only the answers object will be present, and that only when the top-level opcode = 1 which indicates an inverse query.

Note that the sub-fields name (and e164_digits), type, class, ttl are common to all DNS response records. All other sub-fields are specific to individual record Types. At this time the only supported response record types for which extra sub-fields will be decoded are the following:

Field Type Description
.name String [Required] The name of the record as a dot-notation string.
.type Integer [Required] The integer value of the Type, e.g. 35 indicating NAPTR.
.class Integer [Required] The integer value of the Class, e.g. 1 indicating IN.
.e164_digits String If the name appears to be an E.164 digit string, then the decoded (non-dot-notation) ASCII address string equivalent E.164 address will be decoded and provided here. It will not be given a '+' prefix.
.order Integer [Required for NAPTR (Type = 35)] The Order value (0-65535) supplied in the NAPTR response record.
.preference Integer [Required for NAPTR (Type = 35)] The Preference value (0-65535) supplied in the NAPTR response record.
.flags Integer [Required for NAPTR (Type = 35)] An integer representation of the flags supplied in the NAPTR response record.
.service String [Required for NAPTR (Type = 35)] The Service string supplied in the NAPTR response record.
.regex String [Required for NAPTR (Type = 35)] The Regex string (if any) supplied in the NAPTR response record.
.replacement String [Required for NAPTR (Type = 35)] The Replacement domain name (if any) supplied in the NAPTR response record, expressed as a dot-separated domain name.

DNS-S-RESPONSE

The DNS-S-RESPONSE message is sent back to the DnsServerApp by the handling application when it is ready to send an DNS/ENUM Response to the original received DNS/ENUM Request.

The attributes of the DNS-S-RESPONSE message are:

All the other answer fields will have default values applied.
Field Type Description
success 0/1 [Required] Indicates if the request handling was successful or not.
error String Indicates the reason why the request handling failed.
Present and applicable only if success == 0.
dns Object Container for the ENUM response parameters we are to send.
Present only if success == 1.
.authoritative_answer 0 / 1 Should the response set the 1-bit AA value in the top-level flags.
(Default = 0)
.recursion_available 0 / 1 Should the response set the 1-bit RA value in the top-level flags.
(Default = 0)
.authenticated_data 0 / 1 Should the response set the 1-bit AD value in the top-level flags.
(Default = 0)
.reply_code 0 - 15 The top-level 4-bit Reply Code to set in the top-level flags.
A value of 0 indicates success and should always be used when returning any answer entries.
(Default = 0)
.sip_e2u_regex String This is a special indicator which requests the response to construct a single answer entry.
This answer entry will have type = 35 (NAPTR) and clase = 35 (IN).
The service field will be set to SIP+E2U and the regex field will have the specified value.