From 1f4904881019efe275ba0e80b6beb5a2355e0b23 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 15 Sep 2015 21:22:23 -0400 Subject: documentation --- debian/changelog | 4 ++++ src/Propellor/Property/Dns.hs | 4 +++- src/Propellor/Types/Dns.hs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3