add SOA
This commit is contained in:
parent
8dcd8fb0bd
commit
21bb63ab58
|
@ -141,6 +141,7 @@ rField (CNAME _) = "CNAME"
|
||||||
rField (MX _ _) = "MX"
|
rField (MX _ _) = "MX"
|
||||||
rField (NS _) = "NS"
|
rField (NS _) = "NS"
|
||||||
rField (TXT _) = "TXT"
|
rField (TXT _) = "TXT"
|
||||||
|
rField (SRV _ _ _ _) = "SRV"
|
||||||
|
|
||||||
rValue :: Record -> String
|
rValue :: Record -> String
|
||||||
rValue (Address (IPv4 addr)) = addr
|
rValue (Address (IPv4 addr)) = addr
|
||||||
|
@ -148,6 +149,12 @@ rValue (Address (IPv6 addr)) = addr
|
||||||
rValue (CNAME d) = dValue d
|
rValue (CNAME d) = dValue d
|
||||||
rValue (MX pri d) = show pri ++ " " ++ dValue d
|
rValue (MX pri d) = show pri ++ " " ++ dValue d
|
||||||
rValue (NS d) = dValue d
|
rValue (NS d) = dValue d
|
||||||
|
rValue (SRV priority weight port target) = unwords
|
||||||
|
[ show priority
|
||||||
|
, show weight
|
||||||
|
, show port
|
||||||
|
, dValue target
|
||||||
|
]
|
||||||
rValue (TXT s) = [q] ++ filter (/= q) s ++ [q]
|
rValue (TXT s) = [q] ++ filter (/= q) s ++ [q]
|
||||||
where
|
where
|
||||||
q = '"'
|
q = '"'
|
||||||
|
|
|
@ -57,6 +57,7 @@ data Record
|
||||||
| MX Int BindDomain
|
| MX Int BindDomain
|
||||||
| NS BindDomain
|
| NS BindDomain
|
||||||
| TXT String
|
| TXT String
|
||||||
|
| SRV Word16 Word16 Word16 BindDomain
|
||||||
deriving (Read, Show, Eq, Ord)
|
deriving (Read, Show, Eq, Ord)
|
||||||
|
|
||||||
getIPAddr :: Record -> Maybe IPAddr
|
getIPAddr :: Record -> Maybe IPAddr
|
||||||
|
|
Loading…
Reference in New Issue