--- | Convert the given IP address (as a ByteString) to the format
--- required for a PTR lookup. For example, "192.168.0.0" should be
--- converted to "0.0.168.192.in-addr.arpa".
-ip_to_in_addr_arpa :: Domain -> Domain
-ip_to_in_addr_arpa ip =
- rev_ip `BS.append` suffix
- where
- dot = BS.pack "."
- suffix = BS.pack ".in-addr.arpa"
- rev_ip = BS.intercalate dot (reverse (BS.split '.' ip))
-