nsupdate delete question

2009-04-30 Thread James M
Hi-
While invoking nsupdate within a program I notice that trying to
delete a nonexistant host does not return an error.
Same thing seems to happen from the command line which I will show next..

[r...@mandy4 ccadns]# nslookup mandy11.example.com
Server: 204.62.134.38
Address:204.62.134.38#53

** server can't find mandy11.example.com: NXDOMAIN

[r...@mandy4 ccadns]# nsupdate -d delete11
Sending update to 204.62.134.38#53
Outgoing update query:
;; -HEADER- opcode: UPDATE, status: NOERROR, id:  37857
;; flags: ; ZONE: 1, PREREQ: 0, UPDATE: 1, ADDITIONAL: 1
;; ZONE SECTION:
;example.com.   IN  SOA

;; UPDATE SECTION:
mandy11.example.com.0   ANY A

;; TSIG PSEUDOSECTION:
mandy4.example.com. 0   ANY TSIG
hmac-md5.sig-alg.reg.int. 124107 300 16 blahblah== 37857 NOERROR 0


Reply from update query:
;; -HEADER- opcode: UPDATE, status: NOERROR, id:  37857
;; flags: qr ra ; ZONE: 0, PREREQ: 0, UPDATE: 0, ADDITIONAL: 1
;; TSIG PSEUDOSECTION:
mandy4.example.com. 0   ANY TSIG
hmac-md5.sig-alg.reg.int. 124107 300 16 blahblah== 37857 NOERROR 0


[r...@mandy4 ccadns]#

[r...@mandy4 ccadns]# cat delete11
key mandy4.example. blahblahblah
server mandy4.example.com
zone example.com
update delete mandy11.example.com a
send
[r...@mandy4 ccadns]#

As you can see from the nslookup mandy11 does not exist within dns yet
nsupdate delete mandy11 seems to work.
Am I missing something in the response section indicating an error?
Or can you recommend another approach to avoiding misleading a user
into thinking his host was deleted properly?
Thanks for the help...
-Jim
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: nsupdate delete question

2009-04-30 Thread Chris Thompson

On Apr 30 2009, James M wrote:


While invoking nsupdate within a program I notice that trying to
delete a nonexistant host does not return an error.


That's a result of the way that RFC 2136 defined update operations.
Read section 3, and note in particular that errors are never generated
in 3.4.2. Sometimes this is a damn nuisance (one would really prefer
BIND to give an error when trying to create an RR co-existing with
a CNAME, for example, rather than ignoring the update), but not really
in your case. Being able to delete RR(s) if they exist, but do nothing
if they don't, is a perfectly reasonable requirement.

What you need to do is to add a prereq requiring the RRset to exist
(prereq yxrrset mandy11.example.com A) or for it to have particular
contents (prereq yxrrset mandy11.example.com A 192.168.255.42)
before it is deleted.

--
Chris Thompson
Email: c...@cam.ac.uk
___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users


Re: nsupdate delete question

2009-04-30 Thread Niall O'Reilly
On Thu, 2009-04-30 at 10:18 -0400, James M wrote:
 trying to
 delete a nonexistant host does not return an error.

That seems reasonable to me, since the state of the
zone file after the transaction is indeed the state
which would be expected, had the host been present and
deleted.

If you need to ensure that there actually was a change
to the state of the zone, you could specify a prerequisite
in your transaction file, insisting that the RRset or
label of interest is present before deletion.

Something like this might do the trick.

key mandy4.example. blahblahblah
server mandy4.example.com
zone example.com

prereq yxrrset mandy11.example.com a

update delete mandy11.example.com a
send

IHTH
/Niall


___
bind-users mailing list
bind-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/bind-users