-dataRR RRTypeSOA = soa
- where
- soa name dom = -- FIXME generate only for top domain
- -- FIXME make realistic version field
- -- FIXME make realistic nameserver field
- -- Follows a relatively ugly hack to figure if we are at the top
- -- level domain ("something.bit"). Only in such case we provide
- -- the synthetic SOA RR. Otherwise yield empty.
+dataRR RRTypeSOA = \ name dom -> -- FIXME make realistic version field
+ let
+ ns = case domNs dom of
+ Just (x:_) -> x -- FIXME Terminate with a dot?
+ _ -> "."
+ email = case domEmail dom of
+ Nothing -> "hostmaster." ++ name ++ "."
+ Just addr -> dotmail addr
+ in
+ if dom == emptyNmcDom then []
+ else
+ -- Follows a relatively ugly hack to figure if we are at the top
+ -- level domain ("something.bit"). Only in such case we provide
+ -- the synthetic SOA RR. Otherwise yield empty.
+ -- Alternative would be to carry "top-ness" as a parameter through
+ -- all the calls from the very top where we split the fqdn.