Reverse zones made easy: suggested, filled, in the right view, PTRs kept in step
Missing reverse zones are suggested for the private views' A and AAAA records (/24 for private IPv4, /32 for a public address, /48 for IPv6) and created filled with PTR records (jarl zone suggest-reverse, the Zones page). zone create --fill and zone fill-ptr add the PTRs a reverse zone lacks; a reverse zone created without a view goes to the private view using its addresses. Per zone, auto_ptr keeps the PTR records of A and AAAA records in step on every change (database version 12). Zone commands take a network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a3b054cc86
commit
aa4b004a14
27 files changed
+1173
-38
No files matched your search
@@ -640,6 +640,46 @@ expect_dig "enabled zone served again" "192.0.2.70" www.parked.test A
|
||||
expect_dig "with the change made while disabled" "192.0.2.71" api.parked.test A
|
||||
run "delete it" 0 $J zone delete parked.test --view internal --yes
|
||||
|
||||
# Reverse zones made easy (docs/reverse.md): suggested from the records'
|
||||
# addresses, created in the right view and filled, PTRs kept in step.
|
||||
run "zone for reverse" 0 $J zone create revtest.test --view internal --ns ns1.adbraun.test.
|
||||
run "its hosts" 0 $J record add revtest.test nas A 10.99.1.10 --view internal
|
||||
run "a second name for nas" 0 $J record add revtest.test files A 10.99.1.10 --view internal
|
||||
run "another host" 0 $J record add revtest.test pi A 10.99.1.11 --view internal
|
||||
run "and IPv6" 0 $J record add revtest.test nas AAAA fdab:99:0:10::10 --view internal
|
||||
run "suggest-reverse" 0 $J zone suggest-reverse
|
||||
contains "^internal *10.99.1.0/24 *1.99.10.in-addr.arpa *2 *10.99.1.10 files.revtest.test, 10.99.1.11 pi.revtest.test"
|
||||
contains "^internal *fdab:99::/48 *0.0.0.0.9.9.0.0.b.a.d.f.ip6.arpa *1"
|
||||
run "create it without a view, filled" 0 $J zone create 10.99.1.0/24 --fill
|
||||
contains "10.99.1.10 has several names"
|
||||
run "it went to the internal view" 0 $J zone show 1.99.10.in-addr.arpa
|
||||
contains "^View: *internal"
|
||||
contains "^Network: *10.99.1.0/24"
|
||||
not_contains "Missing PTRs"
|
||||
expect_dig "filled: PTR for pi" "pi.revtest.test." -x 10.99.1.11
|
||||
expect_dig "filled: one name for nas" "files.revtest.test." -x 10.99.1.10
|
||||
run "an empty /48 zone" 0 $J zone create fdab:99::/48
|
||||
run "shows what it lacks" 0 $J zone show fdab:99::/48
|
||||
contains "^Missing PTRs: *1 "
|
||||
run "fill-ptr" 0 $J zone fill-ptr fdab:99::/48
|
||||
expect_dig "filled later: IPv6 PTR" "nas.revtest.test." -x fdab:99:0:10::10
|
||||
run "fill-ptr again: nothing to add (exit 6)" 6 $J zone fill-ptr fdab:99::/48
|
||||
contains "nothing to add"
|
||||
run "keep PTRs in step" 0 $J zone update revtest.test --view internal --auto-ptr
|
||||
run "zone show says so" 0 $J zone show revtest.test --view internal
|
||||
contains "^PTR records: *kept in step"
|
||||
run "a new host" 0 $J record add revtest.test cam A 10.99.1.12 --view internal
|
||||
expect_dig "its PTR came along" "cam.revtest.test." -x 10.99.1.12
|
||||
CAM=$($J record list revtest.test --view internal -o json | python3 -c 'import json,sys; print([r["id"] for r in json.load(sys.stdin) if r["name"].startswith("cam.")][0])')
|
||||
run "the host moves" 0 $J record update $CAM --data 10.99.1.13
|
||||
expect_dig "PTR followed: new address" "cam.revtest.test." -x 10.99.1.13
|
||||
expect_dig "PTR followed: old address gone" "" -x 10.99.1.12
|
||||
run "the host goes" 0 $J record delete --id $CAM
|
||||
expect_dig "PTR gone with it" "" -x 10.99.1.13
|
||||
run "suggest-reverse --create" 0 $J zone suggest-reverse --create
|
||||
run "nothing missing now" 0 $J zone suggest-reverse
|
||||
contains "No reverse zones missing."
|
||||
|
||||
# Blocking (docs/blocking.md). It only changes answers to recursive
|
||||
# queries, so these ask with recursion and look at which policy zone (if
|
||||
# any) the answer came from.
|
||||
|
||||
Reference in new issue
Block a user