Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data types for DNS Query and Response. For more information, see http://www.ietf.org/rfc/rfc1035.
- data ResourceRecord = ResourceRecord {}
- type Domain = ByteString
- type CLASS = Word16
- classIN :: CLASS
- type TTL = Word32
- data TYPE
- fromTYPE :: TYPE -> Word16
- toTYPE :: Word16 -> TYPE
- data RData
- = RD_A IPv4
- | RD_NS Domain
- | RD_CNAME Domain
- | RD_SOA Domain Mailbox Word32 Word32 Word32 Word32 Word32
- | RD_NULL
- | RD_PTR Domain
- | RD_MX Word16 Domain
- | RD_TXT ByteString
- | RD_AAAA IPv6
- | RD_SRV Word16 Word16 Word16 Domain
- | RD_DNAME Domain
- | RD_OPT [OData]
- | RD_DS Word16 Word8 Word8 ByteString
- | RD_DNSKEY Word16 Word8 Word8 ByteString
- | RD_TLSA Word8 Word8 Word8 ByteString
- | UnknownRData ByteString
- data DNSMessage = DNSMessage {
- header :: DNSHeader
- question :: [Question]
- answer :: [ResourceRecord]
- authority :: [ResourceRecord]
- additional :: [ResourceRecord]
- defaultQuery :: DNSMessage
- defaultResponse :: DNSMessage
- type DNSFormat = DNSMessage
- data DNSHeader = DNSHeader {}
- type Identifier = Word16
- data QorR
- data DNSFlags = DNSFlags {
- qOrR :: QorR
- opcode :: OPCODE
- authAnswer :: Bool
- trunCation :: Bool
- recDesired :: Bool
- recAvailable :: Bool
- rcode :: RCODE
- authenData :: Bool
- data OPCODE
- data RCODE
- fromRCODE :: RCODE -> Word16
- toRCODE :: Word16 -> RCODE
- fromRCODEforHeader :: RCODE -> Word16
- toRCODEforHeader :: Word16 -> RCODE
- data Question = Question {}
- data DNSError
- data EDNS0
- defaultEDNS0 :: EDNS0
- udpSize :: EDNS0 -> Word16
- extRCODE :: EDNS0 -> RCODE
- dnssecOk :: EDNS0 -> Bool
- options :: EDNS0 -> [OData]
- fromEDNS0 :: EDNS0 -> ResourceRecord
- toEDNS0 :: DNSFlags -> ResourceRecord -> Maybe EDNS0
- data OData
- data OptCode
- fromOptCode :: OptCode -> Word16
- toOptCode :: Word16 -> OptCode
- type Mailbox = ByteString
Resource Records
Types
type Domain = ByteString Source #
Type for domain.
Resource Record Types
Resource Data
Raw data format for each type.
RD_A IPv4 | IPv4 address |
RD_NS Domain | An authoritative name serve |
RD_CNAME Domain | The canonical name for an alias |
RD_SOA Domain Mailbox Word32 Word32 Word32 Word32 Word32 | Marks the start of a zone of authority |
RD_NULL | A null RR (EXPERIMENTAL). Anything can be in a NULL record, for now we just drop this data. |
RD_PTR Domain | A domain name pointer |
RD_MX Word16 Domain | Mail exchange |
RD_TXT ByteString | Text strings |
RD_AAAA IPv6 | IPv6 Address |
RD_SRV Word16 Word16 Word16 Domain | Server Selection (RFC2782) |
RD_DNAME Domain | DNAME (RFC6672) |
RD_OPT [OData] | OPT (RFC6891) |
RD_DS Word16 Word8 Word8 ByteString | Delegation Signer (RFC4034) RD_RRSIG RD_NSEC |
RD_DNSKEY Word16 Word8 Word8 ByteString | DNSKEY (RFC4034) RD_NSEC3 RD_NSEC3PARAM |
RD_TLSA Word8 Word8 Word8 ByteString | TLSA (RFC6698) RD_CDS RD_CDNSKEY RD_CSYNC |
UnknownRData ByteString | Unknown resource data |
DNS Message
data DNSMessage Source #
Raw data format for DNS Query and Response.
DNSMessage | |
|
defaultQuery :: DNSMessage Source #
Default query.
defaultResponse :: DNSMessage Source #
Default response.
type DNSFormat = DNSMessage Source #
Deprecated: Use DNSMessage instead
For backward compatibility.
DNS Header
Raw data format for the header of DNS Query and Response.
DNSHeader | |
|
type Identifier = Word16 Source #
An identifier assigned by the program that generates any kind of query.
Query or response.
QR_Query | Query. |
QR_Response | Response. |
Raw data format for the flags of DNS Query and Response.
DNSFlags | |
|
Kind of query.
Response code including EDNS0's 12bit ones.
fromRCODEforHeader :: RCODE -> Word16 Source #
From rcode to number for header (4bits only).
toRCODEforHeader :: Word16 -> RCODE Source #
From number in header to rcode (4bits only).
DNS Body
Raw data format for DNS questions.
DNS Error
An enumeration of all possible DNS errors that can occur.
SequenceNumberMismatch | The sequence number of the answer doesn't match our query. This could indicate foul play. |
RetryLimitExceeded | The number of retries for the request was exceeded. |
TimeoutExpired | TCP fallback request timed out. |
UnexpectedRDATA | The answer has the correct sequence number, but returned an unexpected RDATA format. |
IllegalDomain | The domain for query is illegal. |
FormatError | The name server was unable to interpret the query. |
ServerFailure | The name server was unable to process this query due to a problem with the name server. |
NameError | This code signifies that the domain name referenced in the query does not exist. |
NotImplemented | The name server does not support the requested kind of query. |
OperationRefused | The name server refuses to perform the specified operation for policy reasons. For example, a name server may not wish to provide the information to the particular requester, or a name server may not wish to perform a particular operation (e.g., zone transfer) for particular data. |
BadOptRecord | The server detected a malformed OPT RR. |
BadConfiguration | Configuration is wrong. |
NetworkFailure IOException | Network failure. |
UnknownDNSError | Error is unknown |
EDNS0
defaultEDNS0 :: EDNS0 Source #
Default information for EDNS0.
>>>
defaultEDNS0
EDNS0 {udpSize = 4096, extRCODE = NoError, dnssecOk = False, options = []}
Accessors
Converters
fromEDNS0 :: EDNS0 -> ResourceRecord Source #
toEDNS0 :: DNSFlags -> ResourceRecord -> Maybe EDNS0 Source #
Generating EDNS0 information from the OPT RR.
EDNS0 option data
Optional resource data.
OD_ClientSubnet Word8 Word8 IP | Client subnet (RFC7871) |
UnknownOData OptCode ByteString | Unknown optional type |
EDNS0 Option Code (RFC 6891).
fromOptCode :: OptCode -> Word16 Source #
From option code to number.
Other types
type Mailbox = ByteString Source #
Type for a mailbox encoded on the wire as a DNS name, but the first label
is conceptually the user name, and sometimes has internal .
characters
that are not label separators.