Querying

  • All communications inside of the domain protocol are carried in a single format called a message. The top level format of message is divided into 5 sections (some of which are empty in certain cases) shown below:

    +---------------------+
    |        Header       |
    +---------------------+
    |       Question      | the question for the name server
    +---------------------+
    |        Answer       | RRs answering the question
    +---------------------+
    |      Authority      | RRs pointing toward an authority
    +---------------------+
    |      Additional     | RRs holding additional information
    +---------------------+
    

    The header section is always present. The header includes fields that specify which of the remaining sections are present, and also specify whether the message is a query or a response, a standard query or some other opcode, etc.

    The names of the sections after the header are derived from their use in standard queries. The question section contains fields that describe a question to a name server. These fields are a query type (QTYPE), a query class (QCLASS), and a query domain name (QNAME). The last three sections have the same format: a possibly empty list of concatenated resource records (RRs). The answer section contains RRs that answer the question; the authority section contains RRs that point toward an authoritative name server; the additional records section contains RRs which relate to the query, but are not strictly answers for the question.

    See more

    Declaration

    Swift

    public struct Message
    extension Message: CustomDebugStringConvertible
  • A one bit field that specifies whether this message is a query (0), or a response (1).

    • query: query to a name server
    • response: response from a name server
    See more

    Declaration

    Swift

    public enum MessageType
  • A four bit field that specifies kind of query in this message. This value is set by the originator of a query and copied into the response.

    • query: a standard query (QUERY)
    • inverseQuery: an inverse query (IQUERY)
    • statusRequest: a server status request (STATUS)
    • notify: (NOTIFY)
    • update: (UPDATE)

    Declaration

    Swift

    public typealias OperationCode = UInt8
  • Declaration

    Swift

    public extension OperationCode
  • Undocumented

    See more

    Declaration

    Swift

    public struct Question
  • Response code - this 4 bit field is set as part of responses.

    Declaration

    Swift

    public typealias ReturnCode = UInt8
  • Declaration

    Swift

    public extension ReturnCode