dnscache-0.1.0: Caching DNS resolver library and mass DNS resolver utility

Stabilityexperimental
MaintainerErtugrul Soeylemez <es@ertes.de>

Network.DnsCache

Contents

Description

This module implements an asynchronous, caching DNS resolver.

Synopsis

DNS cache

data DnsCache Source

DNS cache configuration.

withDnsCache :: Int -> NominalDiffTime -> (DnsCache -> IO a) -> IO aSource

Start a DNS cache with the given number of resolver threads and the given cache timeout.

DNS lookup

resolveA :: DnsCache -> Domain -> IO (Maybe [IPv4])Source

Resolve an A record.

resolveAAAA :: DnsCache -> Domain -> IO (Maybe [IPv6])Source

Resolve an AAAA record.

resolveMX :: DnsCache -> Domain -> IO (Maybe [Domain])Source

Resolve an MX record.

DNS mass lookup

data MassResult Source

Result of a mass lookup.

Constructors

MassResult 

Fields

massDomain :: Domain
 
massA :: [IPv4]
 
massAAAA :: [IPv6]
 
massMX :: [Domain]
 

Instances

data MassType Source

The type of resources to look up.

Constructors

MassA 
MassAAAA 
MassMX 
MassAll 

massLookup :: DnsCache -> MassType -> [Domain] -> IO (Map Domain MassResult)Source

Perform a mass lookup.

massLookupReport :: (Base m ~ IO, LiftBase m, Monad m) => DnsCache -> MassType -> [Domain] -> (MassResult -> m ()) -> m ()Source

Perform a mass lookup with report function.