Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data FileOrNumericHost
- data CacheConf = CacheConf {
- maximumTTL :: TTL
- pruningDelay :: Int
- defaultCacheConf :: CacheConf
- data ResolvConf = ResolvConf {
- resolvInfo :: FileOrNumericHost
- resolvTimeout :: Int
- resolvRetry :: Int
- resolvConcurrent :: Bool
- resolvCache :: Maybe CacheConf
- resolvQueryControls :: QueryControls
- defaultResolvConf :: ResolvConf
- data ResolvSeed = ResolvSeed {}
- data Resolver = Resolver {
- resolvseed :: ResolvSeed
- genIds :: NonEmpty (IO Word16)
- cache :: Maybe Cache
Documentation
data FileOrNumericHost Source #
The type to specify a cache server.
RCFilePath FilePath | A path for "resolv.conf" where one or more IP addresses of DNS servers should be found on Unix. Default DNS servers are automatically detected on Windows regardless of the value of the file name. |
RCHostName HostName | A numeric IP address. Warning: host names are invalid. |
RCHostNames [HostName] | Numeric IP addresses. Warning: host names are invalid. |
RCHostPort HostName PortNumber | A numeric IP address and port number. Warning: host names are invalid. |
Instances
Show FileOrNumericHost Source # | |
Defined in Network.DNS.Types.Resolver showsPrec :: Int -> FileOrNumericHost -> ShowS # show :: FileOrNumericHost -> String # showList :: [FileOrNumericHost] -> ShowS # |
Cache configuration for responses.
CacheConf | |
|
defaultCacheConf :: CacheConf Source #
Default cache configuration.
>>>
defaultCacheConf
CacheConf {maximumTTL = 300, pruningDelay = 10}
data ResolvConf Source #
Type for resolver configuration.
Use defaultResolvConf
to create a new value.
An example to use Google's public DNS cache instead of resolv.conf:
>>>
let conf = defaultResolvConf { resolvInfo = RCHostName "8.8.8.8" }
An example to use multiple Google's public DNS cache concurrently:
>>>
let conf = defaultResolvConf { resolvInfo = RCHostNames ["8.8.8.8","8.8.4.4"], resolvConcurrent = True }
An example to disable EDNS:
>>>
let conf = defaultResolvConf { resolvQueryControls = ednsEnabled FlagClear }
An example to enable query result caching:
>>>
let conf = defaultResolvConf { resolvCache = Just defaultCacheConf }
An example to disable requesting recursive service.
>>>
let conf = defaultResolvConf { resolvQueryControls = rdFlag FlagClear }
An example to set the AD bit in all queries by default.
>>>
let conf = defaultResolvConf { resolvQueryControls = adFlag FlagSet }
An example to set the both the AD and CD bits in all queries by default.
>>>
let conf = defaultResolvConf { resolvQueryControls = adFlag FlagSet <> cdFlag FlagSet }
An example with an EDNS buffer size of 1216 bytes, which is more robust with IPv6, and the DO bit set to request DNSSEC responses.
>>>
let conf = defaultResolvConf { resolvQueryControls = ednsSetUdpSize (Just 1216) <> doFlag FlagSet }
ResolvConf | |
|
Instances
Show ResolvConf Source # | |
Defined in Network.DNS.Types.Resolver showsPrec :: Int -> ResolvConf -> ShowS # show :: ResolvConf -> String # showList :: [ResolvConf] -> ShowS # |
defaultResolvConf :: ResolvConf Source #
Return a default ResolvConf
:
resolvInfo
isRCFilePath
"/etc/resolv.conf".resolvTimeout
is 3,000,000 micro seconds.resolvRetry
is 3.resolvConcurrent
is False.resolvCache
is Nothing.resolvQueryControls
is an empty set of overrides.
data ResolvSeed Source #
Intermediate abstract data type for resolvers.
IP address information of DNS servers is generated
according to resolvInfo
internally.
This value can be safely reused for withResolver
.
The naming is confusing for historical reasons.