Core: convert IP addresses to reverse zone (#838)

* Core: convert IP addresses to reverse zone

If we see IP/mask syntax and the mask mod 8 == 0 we assume a reverse
zone and convert to in-addr or .arpa.

* typos

* integration test

* Addr is not used

* core: clean up normalize

Create a SplitHostPort function that can be used both from normalize.go
and address.go. This removes some (not all!) duplication between the
both and makes it work with reverse address notations.

* More tests
This commit is contained in:
Miek Gieben
2017-08-07 13:24:09 -07:00
committed by GitHub
parent 468d5b57de
commit e1c1521ad5
6 changed files with 145 additions and 47 deletions

View File

@@ -168,6 +168,19 @@ example.org {
}
~~~
IP addresses are also allowed. They are automatically converted to reverse zones:
~~~ txt
10.0.0.0/24 {
# ...
}
~~~
Means you are authoritative for `0.0.10.in-addr.arpa.`.
The netmask must be dividable by 8, if it is not the reverse conversion is not done. This also works
for IPv6 addresses. If for some reason you want to serve a zone named `10.0.0.0/24` add the closing
dot: `10.0.0.0/24.` as this also stops the conversion.
Listening on TLS and for gRPC? Use:
~~~ txt