diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-24 18:10:23 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-24 18:10:23 -0400 |
| commit | c4f364b249b810410d329a932dea883f36b9a712 (patch) | |
| tree | d4d4ee86efba15249284a41841e17654d901f1f3 /Propellor/Types | |
| parent | 792957153ca9c22de28da7be83940aa5e07af0fa (diff) | |
| parent | 72a6b1c759906025fd6761aeb5ef51e64e60abd7 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'Propellor/Types')
| -rw-r--r-- | Propellor/Types/Dns.hs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Propellor/Types/Dns.hs b/Propellor/Types/Dns.hs index 9b2ad1e7..ba6a92dd 100644 --- a/Propellor/Types/Dns.hs +++ b/Propellor/Types/Dns.hs @@ -1,5 +1,7 @@ module Propellor.Types.Dns where +import Propellor.Types.OS (HostName) + import Data.Word type Domain = String @@ -14,14 +16,15 @@ fromIPAddr (IPv6 addr) = addr -- | Represents a bind 9 named.conf file. data NamedConf = NamedConf { confDomain :: Domain - , confType :: Type + , confDnsServerType :: DnsServerType , confFile :: FilePath , confMasters :: [IPAddr] + , confAllowTransfer :: [IPAddr] , confLines :: [String] } deriving (Show, Eq, Ord) -data Type = Master | Secondary +data DnsServerType = Master | Secondary deriving (Show, Eq, Ord) -- | Represents a bind 9 zone file. @@ -66,6 +69,10 @@ getCNAME :: Record -> Maybe BindDomain getCNAME (CNAME d) = Just d getCNAME _ = Nothing +getNS :: Record -> Maybe BindDomain +getNS (NS d) = Just d +getNS _ = Nothing + -- | Bind serial numbers are unsigned, 32 bit integers. type SerialNumber = Word32 @@ -78,3 +85,8 @@ type SerialNumber = Word32 -- to add nameservers, MX's, etc to a domain. data BindDomain = RelDomain Domain | AbsDomain Domain | RootDomain deriving (Read, Show, Eq, Ord) + +domainHostName :: BindDomain -> Maybe HostName +domainHostName (RelDomain d) = Just d +domainHostName (AbsDomain d) = Just d +domainHostName RootDomain = Nothing |
