I have added a zone test.net via rndc locally and it is working fine. Next, I want to update it via nsupdate but locally, my zone configurations are,
zone test.net {type master; file "zones-remote/masters/test.net" ; allow-update{localhost;};};
When I do this,
nsupdate
server localhost
zone sample.test.net
update add sample.test.net 86400 A 134.23.32.4
send
It gives the error "update failed: NOTAUTH"
Checking it via show, prior to send gives,
Outgoing update query:
;; ->>HEADER<<- opcode: UPDATE, status: NOERROR, id: 0
;; flags:; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 0
;; ZONE SECTION:
;test.net. IN SOA
;; UPDATE SECTION:
sample.test.net. 86400 IN A 134.23.32.4
When I try,
nsupdate
server localhost
zone test.net # Actual zone name
update add sample.test.net 86400 A 134.23.32.4
send
then the error "SERVFAIL" appears.
My zone file looks like this,
@ 86400 IN SOA test.net. sampling.gmail.com. (
2014101001
3h
1h
1w
30m86400s)
@ 84600 NS ns1.test.net.
@ 84600 IN A 42.42.42.42
ns1 84600 IN A 42.42.42.42
This zone file is correct and it resolves the query against its domain.
Best Answer
When you specify
zone
, you are defining the "origin" for all transactions that follow. The record names that you specify are assumed to be relative to this origin unless a trailing dot is present.zone sample.test.net
, the record should be@
orsample.test.net.
.zone test.net
, the record should besample
orsample.test.net.
.The SERVFAIL happens because your requested record mapped out to
sample.test.net.test.net.
, which falls outside of your definedsample.test.net.
zone.I'm less certain of why you're getting NOTAUTH for the first request (
sample.test.net.sample.test.net.
falls withinsample.test.net.
), but I can't spend a whole lot of time speculating what is going on there when you're running an unsupported version of BIND. Ensure that both yournsupdate
client and the server are running supported versions, and update your question if the problem persists.