network-dns-1.1.0.1: Domain Name System data structures

Safe HaskellNone
LanguageHaskell2010

Network.DNS

Description

This module provides Domain Name System data structures and (de)serialization routines.

Synopsis

Documentation

hostNameLabels :: HostName -> [ByteString] Source #

List the HostName labels:

  hostNameLabels (fromJust (fromString "www.google.com")) = ["www", "google", "com"]

arpaHostName :: IP -> HostName Source #

Host name for reverse DNS lookups.

  toString (arpaHostName (IPv4 (ip4FromOctets 1 2 3 4))) = "4.3.2.1.in-addr.arpa"
  toString (arpaHostName (IPv6 (ip6FromWords 1 2 3 4 5 6 7 8))) = "8.0.0.0.7.0.0.0.6.0.0.0.5.0.0.0.4.0.0.0.3.0.0.0.2.0.0.0.1.0.0.0.ip6.arpa"

data HostAddr a Source #

Host address. Either a host name or an IP address.

Constructors

HostName !HostName 
HostAddr !a 

Instances

Eq a => Eq (HostAddr a) Source # 

Methods

(==) :: HostAddr a -> HostAddr a -> Bool #

(/=) :: HostAddr a -> HostAddr a -> Bool #

Ord a => Ord (HostAddr a) Source # 

Methods

compare :: HostAddr a -> HostAddr a -> Ordering #

(<) :: HostAddr a -> HostAddr a -> Bool #

(<=) :: HostAddr a -> HostAddr a -> Bool #

(>) :: HostAddr a -> HostAddr a -> Bool #

(>=) :: HostAddr a -> HostAddr a -> Bool #

max :: HostAddr a -> HostAddr a -> HostAddr a #

min :: HostAddr a -> HostAddr a -> HostAddr a #

Read a => Read (HostAddr a) Source # 
Show a => Show (HostAddr a) Source # 

Methods

showsPrec :: Int -> HostAddr a -> ShowS #

show :: HostAddr a -> String #

showList :: [HostAddr a] -> ShowS #

Printable (InetAddr a) => Printable (InetAddr (HostAddr a)) Source # 

Methods

print :: Printer p => InetAddr (HostAddr a) -> p #

Printable a => Printable (HostAddr a) Source # 

Methods

print :: Printer p => HostAddr a -> p #

Textual (InetAddr a) => Textual (InetAddr (HostAddr a)) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (InetAddr (HostAddr a)) #

Textual a => Textual (HostAddr a) Source # 

Methods

textual :: (Monad μ, CharParsing μ) => μ (HostAddr a) #

aHostAddrOf :: Proxy a -> Proxy (HostAddr a) Source #

HostAddr a proxy value.

type DnsId = Word16 Source #

Message identifier.

data DnsType α where Source #

Resource Record type.

Instances

Eq (DnsType α) Source # 

Methods

(==) :: DnsType α -> DnsType α -> Bool #

(/=) :: DnsType α -> DnsType α -> Bool #

Show (DnsType α) Source # 

Methods

showsPrec :: Int -> DnsType α -> ShowS #

show :: DnsType α -> String #

showList :: [DnsType α] -> ShowS #

dnsTypeCode :: DnsType α -> Word16 Source #

Numeric representation of a Resource Record type.

data DnsData Source #

Resource Record data.

Constructors

DnsData 

Fields

Instances

data DnsRecord Source #

Resource Record.

Constructors

DnsRecord 

Fields

dnsQTypeCode :: DnsQType -> Word16 Source #

Numeric representation of a DNS query type.

data DnsReq Source #

Request message.

Constructors

DnsReq

Standard query

Fields

DnsInvReq

Inverse query

Fields

data DnsResp Source #

Response message.

Constructors

DnsResp

Normal response.

Fields

DnsErrResp

Error response.

Fields