summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2015-09-15 21:22:23 -0400
committerJoey Hess2015-09-15 21:29:03 -0400
commit1f4904881019efe275ba0e80b6beb5a2355e0b23 (patch)
tree042cb4af87819b5341e71cd701a63f384facd05b
parentf3f7bb19bb6f30f48ae6d7e272bc59b7fa8efd10 (diff)
documentation
-rw-r--r--debian/changelog4
-rw-r--r--src/Propellor/Property/Dns.hs4
-rw-r--r--src/Propellor/Types/Dns.hs3
3 files changed, 10 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 791cc04b..8969a5d1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,10 @@ propellor (2.8.0) UNRELEASED; urgency=medium
Thanks, Mario Lang
* Added Propellor.Property.Unbound for the caching DNS server.
Thanks, Félix Sipma.
+ * Added PTR to Dns.Record. While this is ignored by
+ Propellor.Property.Dns for now, since reverse DNS setup is not
+ implemented there yet, it can be used in other places, eg Unbound.
+ Thanks, Félix Sipma.
* PrivData converted to newtype (API change).
* Stopped stripping trailing newlines when setting PrivData;
this was previously done to avoid mistakes when pasting eg passwords
diff --git a/src/Propellor/Property/Dns.hs b/src/Propellor/Property/Dns.hs
index da063e0e..056733cd 100644
--- a/src/Propellor/Property/Dns.hs
+++ b/src/Propellor/Property/Dns.hs
@@ -28,7 +28,9 @@ import qualified Data.Map as M
import qualified Data.Set as S
import Data.List
--- | Primary dns server for a domain.
+-- | Primary dns server for a domain, using bind.
+--
+-- Currently, this only configures bind to serve forward DNS, not reverse DNS.
--
-- Most of the content of the zone file is configured by setting properties
-- of hosts. For example,
diff --git a/src/Propellor/Types/Dns.hs b/src/Propellor/Types/Dns.hs
index 1c83854e..4a0dd805 100644
--- a/src/Propellor/Types/Dns.hs
+++ b/src/Propellor/Types/Dns.hs
@@ -96,12 +96,15 @@ data Record
| PTR ReverseIP
deriving (Read, Show, Eq, Ord, Typeable)
+-- | An in-addr.arpa record corresponding to an IPAddr.
type ReverseIP = String
reverseIP :: IPAddr -> ReverseIP
reverseIP (IPv4 addr) = intercalate "." (reverse $ split "." addr) ++ ".in-addr.arpa"
reverseIP addr@(IPv6 _) = reverse (intersperse '.' $ replace ":" "" $ fromIPAddr $ canonicalIP addr) ++ ".ip6.arpa"
+-- | Converts an IP address (particularly IPv6) to canonical, fully
+-- expanded form.
canonicalIP :: IPAddr -> IPAddr
canonicalIP (IPv4 addr) = IPv4 addr
canonicalIP (IPv6 addr) = IPv6 $ intercalate ":" $ map canonicalGroup $ split ":" $ replaceImplicitGroups addr