--- /dev/null
+Reply to question for qname='www3.example.net.', qtype=A
+Rcode: 0 (No Error), RD: 1, QR: 1, TC: 0, AA: 0, opcode: 0
+0 www3.example.net. IN CNAME 0 www2.example.net.
local-port=5301
socket-dir=$(pwd)/recursor-service3S
lua-config-file=$(pwd)/recursor-service3/config.lua
+lua-dns-script=$(pwd)/recursor-service3/script.lua
EOF
*.arthur.example.net CNAME *. ; NODATA for everything below the apex
srv.arthur.example.net CNAME rpz-passthru. ; Allow this name though
www.example.net CNAME www2.example.net. ; Local-Data Action
+www3.example.net CNAME www4.example.net. ; Local-Data Action (to be changed in preresolve)
32.4.2.0.192.rpz-ip CNAME rpz-drop. ; www4.example.net resolves to 192.0.2.4, drop A responses with that IP
EOF
+
+cat > recursor-service3/script.lua <<EOF
+function preresolve(dq)
+ if dq.appliedPolicy.policyKind == pdns.policykinds.Custom then
+ if dq.qname:equal("www3.example.net") then
+ dq.appliedPolicy.policyCustom = "www2.example.net"
+ end
+ end
+ return false
+end
+EOF