Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Net DNS Update problem

Reply
Thread Tools

Net DNS Update problem

 
 
milney_boy
Guest
Posts: n/a
 
      03-21-2007
Hello,

I'm trying to write a script to update records on my BIND server. To
start with I am writing a simple script to add and delete A records.

I want to be able to have multiple A records with the same hostname/
alias but with different IP addresses. When it comes to deleting
them, I want to use the yxrrset to make sure the exact record exists
first (so that i know if for some reason it does not exist).

The problem is that whilst the value-dependant yxrrset seems to work
correctly when there is only a single A record with the same hostname/
alias, it always reports nxrrset when there is more than one.

I have cut my code right down to try and get to the bottom of it, but
it is still not working:

----------------------------------------------
#!/usr/bin/perl -w
user Net:NS;

my $update = Net:NS::Update->new("mydomain.com");

$update->push("pre", yxrrset("two.mydomain.com A 212.212.31.212"));

my $res = Net:NS::Resolver->new;
$res->nameserver("ns1.mydnshost.com");

my $reply = $res->send($update);
print $reply->header->string . "\n";
----------------------------------------------

When nslookup shows:
Name: two.mydomain.com
Address: 212.212.31.212
Output is:
;; id = 45744
;; qr = 1 opcode = UPDATE rcode = NOERROR
;; zocount = 0 prcount = 0 upcount = 0 adcount = 0

When nslookup shows:
Name: two.mydomain.com
Address: 212.212.31.212
Name: two.mydomain.com
Address: 212.212.31.213
Output is:
;; id = 28698
;; qr = 1 opcode = UPDATE rcode = NXRRSET
;; zocount = 0 prcount = 0 upcount = 0 adcount = 0

Any ideas on why this might be? It seems that the second you add
multiple records the value-dependany yxrrset does not match any of the
records.

I've tried adding the TTL into the yxrrset statement but still no luck.

 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      03-22-2007
On Mar 21, 1:58 pm, "milney_boy" <(E-Mail Removed)> wrote:

> I'm trying to write a script to update records on my BIND server. To
> start with I am writing a simple script to add and delete A records.
>
> I want to be able to have multiple A records with the same hostname/
> alias but with different IP addresses. When it comes to deleting
> them, I want to use the yxrrset to make sure the exact record exists
> first (so that i know if for some reason it does not exist).
>
> The problem is that whilst the value-dependant yxrrset seems to work
> correctly when there is only a single A record with the same
> hostname/ alias, it always reports nxrrset when there is more
> than one.


The behaviour of BIND that you are describing appears to be correct
according to RFC2136 section 2.4.2 which states "For this
prerequisite, a requestor adds to the section an _entire_ RRset whose
preexistence is required.". BIND is checking for set _equality_ not
checking for set inclusion.

This, of course, has nothing to do with Perl.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PIX 501 relay client DNS requests out to an internet DNS server? nicough@gmail.com Cisco 1 11-18-2006 03:29 PM
DNS query to internal DNS server from static NAT host none Cisco 5 04-25-2006 03:11 AM
DNS query from outside to internal, public DNS server Lars Bonnesen Cisco 9 04-08-2006 11:16 AM
[ann] net-mdns-0.1 - multicast DNS and DNS service discovery Sam Roberts Ruby 0 03-20-2005 05:39 PM
DNS question - reverse DNS getting cluttered Jose Padilla Computer Support 0 01-21-2004 10:29 PM



Advertisments