Problem scripting dynamic updates to "subdomain"

Rich Parkin RParkin at ldmi.com
Wed Jul 14 13:05:59 UTC 2004


That was it!

Now I feel a bit stupid, but thanks for pointing it out.  I was using
the same variable I used to create the update packet to also store the
hostname in the record.  That's what I get for cutting and pasting code
from another script I wrote (that does something a bit different).  In
this case, the zone name and the hostname are completely separate.

Thank you very much!

Richard Parkin
System Administrator
CCNA
Data Center Operations
LDMI Telecommunications

>>> Ronan Flood <ronan at noc.ulcc.ac.uk> 7/14/2004 7:57:21 AM >>>
"Rich Parkin" <RParkin at ldmi.com> wrote:

[... snip lots ...]

> I'm guessing that the answer lies somewhere in the difference
between
> ldmi.net and its' pseudo-subdomains like sample.ldmi.net and how
> Net::DNS constructs the request.

Well, ldmi.net is a zone, sample.ldmi.net isn't.

>     # Create the update packet
>     my $update = Net::DNS::Update->new($zone);
>     
>     # Set prerequisite
>     $update->push(pre => nxrrset("$zone MX $mxpri $mxname"));
>     
>     # Add record to packet
>     $update->push(update => rr_add("$zone MX $mxpri $mxname"));

Assuming $zone is "sample.ldmi.net", you're creating an update
for sample.ldmi.net; I think you need to have

  my $update = Net::DNS::Update->new("ldmi.net.");

or extract the zone name from your $zone appropriately.

> One other thing I need to mention is that the vendor is setting the
> following options and I am not:
> 
> dnssrch(0) #don't use search list
> defnames(0) #don't append default to domain names
> 
> I suppose I could, but I don't see why they would make a difference
> when the variables in Net::DNS are holding the correct values.  (and
in
> fact, they don't make a difference when I put them in)

That might depend on whether or not the names in your variables are
fully-qualified and terminated with '.' -- try and see.

-- 
                      Ronan Flood <R.Flood at noc.ulcc.ac.uk>
                        working for but not speaking for
             Network Services, University of London Computer Centre
     (which means: don't bother ULCC if I've said something you don't
like)



More information about the bind-users mailing list