Re: How to pass all `dig` arguments to Net::DNS?

2017-01-21 Thread Jim Gibson
ample.com" ); > > which lists all the keys to console. > > I want to get at the same info using Perl, with the results in objects that I > can extract data from and assign to variables. > > IIUC, Net::DNS is the right tool. > > Reading the docs I don't

How to pass all `dig` arguments to Net::DNS?

2017-01-20 Thread alanj
, "-t", "A", "\@192.0.2.1", "-k", "/etc/named/keys/T.key", "+noadditional", "+multiline", "+norecurs", "example.com" ); which lists all the keys to console. I want to get at the same info using Perl, with the results

Re: What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Martin G. McCormick
Shlomi Fish writes: > There could be several reasons: > > 1. The @INC of the installed module was perl-version-specific. E.g in my > perl > -V: > As you can see, some of them are versioned and if the previous versions > are not > added to the inc of the new perl, the modules installed there won

Re: What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Shlomi Fish
> > On December 1 of 2014, we were alerted to the fact that > some perl scripts were no longer working. The complaint was > about Net::DNS on one system and Warnings::Unused on another > system and expect.pm on yet another system. > I used cpanp -i to install all the

What Happened to Net::DNS and a few others on December 1?

2014-12-02 Thread Martin G. McCormick
. The complaint was about Net::DNS on one system and Warnings::Unused on another system and expect.pm on yet another system. I used cpanp -i to install all the needed modules with no trouble at all and all the scripts came back to life. I am not complaining at all but curious as to what

Net::DNS::Update

2014-09-18 Thread Martin G. McCormick
have seen/stolen what is being done as in: # Create the update packet. my $update = Net::DNS::Update->new($zone); #This is a list of IP addresses to delete. foreach $zonerecord (@zonedeletes) { #Ev

Re: Best Way to Downgrade Perl Module Net::DNS

2014-01-10 Thread Martin G. McCormick
Shlomi Fish writes: > Hi Martin, > > see https://metacpan.org/release/App-pmuninstall . > > and just for reference, when using Mageia Linux, I normally prefer > packaging > every CPAN distrbution as an .rpm using the tools given here: Thank you. I appreciate this. I use both Linux and F

Re: Best Way to Downgrade Perl Module Net::DNS

2014-01-09 Thread Shlomi Fish
Hi Martin, see https://metacpan.org/release/App-pmuninstall . and just for reference, when using Mageia Linux, I normally prefer packaging every CPAN distrbution as an .rpm using the tools given here: * http://perl-begin.org/topics/cpan/wrappers-for-distributions/ * http://blogs.perl.org/users/

Best Way to Downgrade Perl Module Net::DNS

2014-01-09 Thread Martin G. McCormick
I have been writing a perl script that uses the Net::DNS modules. After banging my head, so to speak for many days, I asked on a DNS-related discussion list for help in figuring out why name server updates had started always failing with errors about not auth and BADKEY when I seem to

Re: script dies when Net::DNS resolve fails

2013-05-13 Thread Dr.Ruud
On 13/05/2013 18:08, David Precious wrote: The usual way to catch exceptions is with an eval block or Try::Tiny etc. Basic example: my $source_address = eval { $res->query(); }; if ($@) { # an error occurred - $@ will contain the message # do something appropriate here } Testi

Re: script dies when Net::DNS resolve fails

2013-05-13 Thread David Precious
On Mon, 13 May 2013 08:53:13 -0700 Noah wrote: > Hi list, > > > When Net::DNS resolved name is not found my script dies. How can I > allow for my script to continue on even if there is a failed DNS > query? The usual way to catch exceptions is with an eval block or Try

Re: script dies when Net::DNS resolve fails

2013-05-13 Thread Lawrence Statton
On 05/13/2013 10:53 AM, Noah wrote: When Net::DNS resolved name is not found my script dies. How can I allow for my script to continue on even if there is a failed DNS query? Impossible to say -- you do not show enough to know what is happening AFTER the block shown. -- To unsubscribe, e

script dies when Net::DNS resolve fails

2013-05-13 Thread Noah
Hi list, When Net::DNS resolved name is not found my script dies. How can I allow for my script to continue on even if there is a failed DNS query? Just cutting and pasting the relevant lines use Net::DNS; my $res = Net::DNS::Resolver->new; my $v6_source_hostn

Re: Net::DNS

2013-03-07 Thread shawn wilson
On Thu, Mar 7, 2013 at 2:04 PM, shawn wilson wrote: > On Thu, Mar 7, 2013 at 12:43 PM, Lawrence Statton wrote: >> On 03/07/2013 11:29 AM, Lawrence Statton wrote: >>> >>> On 03/07/2013 11:00 AM, shawn wilson wrote: However, when I @EXPORT this function from a module, I get this: Can

Re: Net::DNS

2013-03-07 Thread shawn wilson
On Thu, Mar 7, 2013 at 12:29 PM, Lawrence Statton wrote: > On 03/07/2013 11:00 AM, shawn wilson wrote: >> >> However, when I @EXPORT this function from a module, I get this: >> Can't call method "pre" on an undefined value at lib/Misc.pm line 45, >> <> line 723793. > > if (my $answer = $packet->

Re: Net::DNS

2013-03-07 Thread shawn wilson
On Thu, Mar 7, 2013 at 11:40 AM, Lawrence Statton wrote: > On 03/07/2013 10:21 AM, shawn wilson wrote: >> >> use Data::Dumper; >> use Net::DNS::Resolver; >> >> my $dns = Net::DNS::Resolver->new; >> >> print rev_ip('8.8.8.8') . "\n&q

Re: Net::DNS

2013-03-07 Thread Lawrence Statton
On 03/07/2013 10:21 AM, shawn wilson wrote: use Data::Dumper; use Net::DNS::Resolver; my $dns = Net::DNS::Resolver->new; print rev_ip('8.8.8.8') . "\n"; sub rev_ip { my ($ip) = @_; my $packet = $dns->search($ip); my @authority = $packet->authority;

Net::DNS

2013-03-07 Thread shawn wilson
What am I doing wrong here? I'm obviously not understanding what object is being returned by $packet. use strict; use warnings; use Data::Dumper; use Net::DNS::Resolver; my $dns = Net::DNS::Resolver->new; print rev_ip('8.8.8.8') . "\n"; sub rev_ip { my ($ip

Re: update bind via net::dns

2010-08-31 Thread Jeff Peng
2010/8/31 Andreas Moroder : > Hello, > > I would like to update the bind nameserver via a perl script. > Named is running on the same machine I start the script. > I copied the key from > > named.conf > key DHCP_UPDATER { >  algorithm HMAC-MD5.SIG-ALG.REG.INT; >  secret mykeyishere; > }; > > insert

Re: update bind via net::dns ( NOT resolved )

2010-08-31 Thread Andreas Moroder
Hello, I made the following modification to the script $res = new Net::DNS::Resolver(nameservers => [qw(127.0.0.1)]); and now I get Update error code: NOTAUTH. This now looks really like a authorization problem, but, as I wrote, I got the key from named.conf. Bye Andreas --

update bind via net::dns

2010-08-31 Thread Andreas Moroder
"Update error code: REFUSED" Can anyone please tell me what is wrong with this script ? Thanks Andreas # ------- use Net::DNS; $key_name = "tsig-key"; $key = 'mykeyishere'; $tsig = Net::DNS::RR->new("$key_name TSIG $key"

use Net::DNS; how to process variables from axfr??

2008-06-02 Thread Bernard van de Koppel
Hi, When I run the below script, it produces the zone file. However if I try to read the variable $rr (eg " foreach my $rr (@zone) { print("var \n$rr\n"); $rr->print; } , it produces something like Net::DNS::RR::A=HASH(0x855c45c) How can I process this data f

Re: Net::DNS::Resolver

2007-10-24 Thread oryann9
What output do you get when you don't turn off debug? -- I found what is causing this, $query is 'undef' So was it the intent of the person who wrote this module to have this code act in this way? Do you have a recommendation on how to make this more usable in terms of success/failure lookups

Re: Net::DNS::Resolver

2007-10-24 Thread oryann9
> Why is it when I turn off debug mode, I get no output? What output do you get when you don't turn off debug? -- I found what is causing this, $query is 'undef' So was it the intent of the person who wrote this module to have this code act in this way? Do you have a recommendation on how t

Re: Net::DNS::Resolver

2007-10-24 Thread Tom Phoenix
On 10/24/07, oryann9 <[EMAIL PROTECTED]> wrote: > Why is it when I turn off debug mode, I get no output? Are you saying that there's a difference in your program's execution depending upon whether Perl's debugger (activated via the -d command line switch) is or is not running? If that's the case,

Re: Net::DNS::Resolver

2007-10-24 Thread [EMAIL PROTECTED]
On Oct 24, 4:22 pm, [EMAIL PROTECTED] (Oryann9) wrote: > Why is it when I turn off debug mode, I get no output? What output do you get when you don't turn off debug? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Net::DNS::Resolver

2007-10-24 Thread oryann9
All, Why is it when I turn off debug mode, I get no output? I was expecting output similar to what nslookup shows for a simple query. My goal is to look up by NAME and by IP within 2 domains to determine success and failure. use strict; use warnings; use Carp; my $res = Net::DNS::Resolver

Net::DNS

2007-01-26 Thread Perl WANNABE
ogled about and put together this routine partially from the Net::DNS site and from the O'Reilly bind book. This works great.. but it takes 68 minutes.. Am I doing something crazy here or is this normal. I'm not 100% sure if I'm doing it right and I'd appreciate you having

Minimal DNS answer using Net::DNS

2006-11-25 Thread Kelly Jones
I've used xinetd to set up a test nameserver on port 1024. Here's the Net::DNS Perl I'm using to say (falsely) that news.yahoo.com resolves to 10.1.2.3 with a TTL of 1 day: $res = Net::DNS::Packet->new(); $rr = Net::DNS::RR->new("news.yahoo.com. 86400 A 10.1.2.3&q

Net::DNS bgsend

2005-12-18 Thread Rose, Jeff
Hi all, Im trying to query 8 internal dns servers at the same time and make sure that there are at least 2 A records for the Specified device, but I cant seem to get reliable results, I could do it by sending a query to each server and waiting but that takes quite some, whereas using Net::DNS

RE: Net::DNS - Specify a Name Server

2005-08-05 Thread Ryan Frantz
> -Original Message- > From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] > Sent: Friday, August 05, 2005 4:12 PM > To: Ryan Frantz > Cc: beginners@perl.org > Subject: Re: Net::DNS - Specify a Name Server > > Ryan Frantz wrote: > > Perlers, > >

Re: Net::DNS - Specify a Name Server

2005-08-05 Thread Wiggins d'Anconia
Ryan Frantz wrote: > Perlers, > > > > I'd like to use Net::DNS to verify that that my external name servers > are running DNS and returning the correct records. How does one specify > an alternate DNS server to use when querying? > > > > I've

Net::DNS - Specify a Name Server

2005-08-05 Thread Ryan Frantz
Perlers, I'd like to use Net::DNS to verify that that my external name servers are running DNS and returning the correct records. How does one specify an alternate DNS server to use when querying? I've Googled and RTFM but can't seem to find the answer. Is Net::DNS appr

Re: Net::DNS

2005-03-04 Thread DBSMITH
Because I am trying to find a way to get all the clients in a domain via Net::DNS and see if there is an existant "object class" with Server in it. But using Net::DNS I believe will not help b/c I think the website uses java script. Again, here is my problem that needs solved. thank y

Re: Net::DNS

2005-03-04 Thread JupiterHost.Net
My goal is to attain all the devices that have an object class of "Server" and an object class of pc if and only if this entry has a comment referring to "TSM." What does this have to do with listing all the subdomains in a zone for a domain liek in your other email? i don't think anyone is able

Re: Net::DNS

2005-03-04 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: pshrapprd:/home/root> nslookup Default Server: svr Address: 192..x.x.x set type=a s Server: svr Address: 192..x.x.x *** svr can't find s:Non-existent host/domain ls Server: svr.* Address: 192.x.x.x Name:ls ? Commands: (identifiers are shown in uppercase,

Re: Net::DNS

2005-03-04 Thread JupiterHost.Net
[EMAIL PROTECTED] wrote: How would I get all hosts for a particular domain using Net::DNS? I tried *.domainname in my query. Do you mean how to see all the subdomains in a domain's zone file? How would you have do that manually via CLI? (IE not using Perl or other custom program, just SSH i

Re: Net::DNS

2005-03-04 Thread DBSMITH
How would I get all hosts for a particular domain using Net::DNS? I tried *.domainname in my query. thanks, "Wiggins d&#x

Re: Net::DNS

2005-03-04 Thread John Doe
Hello Derek Am Mittwoch, 2. März 2005 17.19 schrieb [EMAIL PROTECTED]: > [...] > > btw: If the 1st FOR LOOP loop failed, @a is empty, so maybe you should > > move the last 3 lines in the 1st FOR LOOP if branch. > > tkx for the pointer! So here is what you mean? > > > foreac

Re: Net::DNS

2005-03-04 Thread John Doe
Hello Thanks much for your answer Am Mittwoch, 2. März 2005 15.15 schrieb Wiggins d'Anconia: > John Doe wrote: > [...] > >My logic says that a condition in the form > >if ($a != $val1 or $a != $val2) > >is always true. > > Unless both are false which is a basic premise of 'or'. I

Re: Net::DNS

2005-03-02 Thread DBSMITH
Maybe a dumb question (since I have no routine with Net::DNS::Resolver): > Are there alway two elements in array @a if everything went fine? No. There are actually 0-9 elements in this array without the "svr" string search > btw: If the 1st FOR LOOP loop failed, @a

Re: Net::DNS

2005-03-02 Thread Wiggins d'Anconia
John Doe wrote: Hi Derek, hi all (see below, please help) [...] my $res = Net::DNS::Resolver->new; my $query = $res->query(".ohnet", "NS"); if ( $query != 0 or $query != undef or $query != ' ' ) { Please replace this condition by if ($

Re: Net::DNS

2005-03-01 Thread John Doe
Hi Derek, hi all (see below, please help) > [...] > > my $res = Net::DNS::Resolver->new; > > my $query = $res->query(".ohnet", "NS"); > > > > > > if ( $query != 0 or $query != undef or $query != ' ' )

Re: Net::DNS

2005-03-01 Thread John Doe
more secure three argument form (see perldoc -f open). > my @a=(); > my $e=0; > my $res = Net::DNS::Resolver->new; > my $query = $res->query(".ohnet", "NS"); > if ( $query != 0 or $query != undef or $query != ' ' ) { - T

Re: Net::DNS

2005-03-01 Thread DBSMITH
Joe, if you still care, here is my final code. Will you please eval it and them comment again? thanks, my $outfile0 = qq(/home/root/dns_servers.plout); open (F, "+>$outfile0") || die "could not open file: $outfile0 $!"; my @a=(); my $e=0; my $res = Net::DNS::Re

Re: Net::DNS

2005-03-01 Thread John Doe
, no code of lines 4 to 13 is executed and no error message is output in this case. This may be fine (don't know the rest of the code). You coul'd eventually shorten the code as follows which makes it a bit more readable (untested): use Net::DNS; my $res = Net::DNS::Resolver->ne

Re: Net::DNS

2005-03-01 Thread DBSMITH
excellent thank you to JuniperHost and you Wiggens. So here is what I ended up with: > 1> use Net::DNS; 2>my $res = Net::DNS::Resolver->new; 3> my $query = $res->query("example.com", "NS"); 4>if ($query != undef) { 5>foreach ($quer

Re: Net::DNS

2005-03-01 Thread Wiggins d'Anconia
return value from calling the 'answer' method on the $query object. 'answer' is an object method and should be documented in Net::DNS. So this says: Loop over every value returned by calling 'answer' on $query, checking to see if calling 'type' on that valu

Re: Net::DNS

2005-03-01 Thread JupiterHost.Net
a record string eq to NS(nameserver) from $query answer? But where does $rr, $_ and answer come from? From the object created in $res->query("example.com", "NS"); This entire line is fuzzy to me. Is there a more beginner way ? I would probably write it like: Do it however

Net::DNS

2005-03-01 Thread DBSMITH
oes errorstring come from? Are there globals in this module that I am missing? I looked on CPAN and did not find any. In general I am having trouble understanding and using this modules potential. 1> use Net::DNS; 2>my $res = Net::DNS::Resolver->new; 3> my $query = $res->que

Re: blacklist monitoring with Net::DNS::Resolver

2005-02-14 Thread Scott Pham
en one of my mail servers gets > blacklisted. > What I want is a function to query in-addr.arpa DNS and return an IP > address. > I used Net::DNS::Resolver, but the output is too long, and I need > something more easy to be parsed. In other words, I need only the ANSWER > SECTION (wh

blacklist monitoring with Net::DNS::Resolver

2005-02-14 Thread Mariano Cunietti
Hi, I'm writing a simple script to perform some periodical checks on dns blacklist, so I can be quickly informed when one of my mail servers gets blacklisted. What I want is a function to query in-addr.arpa DNS and return an IP address. I used Net::DNS::Resolver, but the output is too long,

problem with Net::DNS

2004-09-20 Thread Sergio Vergara Padilla
Hi list: i'm working with Net::DNS, and i have to recover the TXT resource record, but i don't know how to do it, in the documentation says that i have the "txtdata" method available but it didn't say where i have to apply it. have anyone an example code of this met

Re: multiplexing Net::DNS::Nameserver

2004-08-20 Thread Chris Devers
On Fri, 20 Aug 2004, Jeremy Kister wrote: Is there a more advanced Perl list than perl-beginners, where someone may have hints? I've browsed lists.perl.org but found nothing appropriate. There's no "perl-intermediate" that I know of, if that's what you mean. More often, I'd assume people start lo

Re: multiplexing Net::DNS::Nameserver

2004-08-20 Thread Jeremy Kister
On Friday, August 20, 2004 3:50 PM, Wiggins d Anconia wrote: > confused about or are attempting to do. IO::Multiplex works at a > lowlevel on filehandles, specifically sockets. Net::DNS::Nameserver is > designed to be a high-level all inclusive server, aka you don't really > h

RE: multiplexing Net::DNS::Nameserver

2004-08-20 Thread Bob Showalter
Jeremy Kister wrote: > On Wednesday, August 18, 2004 5:56 PM, I wrote: > > can anyone give me a clue as to how to use IO::Multiplex on top of > > Net::DNS::Nameserver? > > Is there a more advanced Perl list than perl-beginners, where someone > may have hints? perlmonks

Re: multiplexing Net::DNS::Nameserver

2004-08-20 Thread Wiggins d Anconia
> On Wednesday, August 18, 2004 5:56 PM, I wrote: > > can anyone give me a clue as to how to use IO::Multiplex on top of > > Net::DNS::Nameserver? > > Is there a more advanced Perl list than perl-beginners, where someone may > have hints? > You could try perlm

Re: multiplexing Net::DNS::Nameserver

2004-08-20 Thread Jeremy Kister
On Wednesday, August 18, 2004 5:56 PM, I wrote: > can anyone give me a clue as to how to use IO::Multiplex on top of > Net::DNS::Nameserver? Is there a more advanced Perl list than perl-beginners, where someone may have hints? I've browsed lists.perl.org but found nothing appropria

multiplexing Net::DNS::Nameserver

2004-08-18 Thread Jeremy Kister
can anyone give me a clue as to how to use IO::Multiplex on top of Net::DNS::Nameserver? I'm assuming that $ns->main_loop would go inside the mux_input sub, but am confused on how IO::Multiplex actually gives data to Net::DNS::Nameserver. Thanks, Jeremy Kister http://jeremy.ki

Re: Problem installing Net::DNS

2004-07-07 Thread Kevin W. Gagel
- Original Message Follows - Date: 7 Jul 2004 14:36:00 - > In article <[EMAIL PROTECTED]>, > >I can't seem to get Net::DNS installed. After it runs its tests it reports: > >Failed 1/19 test scripts, 94.74% okay. 5/816 subtests failed, 99.39% okay. > >

Re: Problem installing Net::DNS

2004-07-07 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Kevin W. Gagel) writes: >I can't seem to get Net::DNS installed. After it runs its tests it reports: >Failed 1/19 test scripts, 94.74% okay. 5/816 subtests failed, 99.39% okay. >make: *** [test_dynamic] Error 2 > /usr/

Problem installing Net::DNS

2004-07-06 Thread Kevin W. Gagel
I can't seem to get Net::DNS installed. After it runs its tests it reports: Failed 1/19 test scripts, 94.74% okay. 5/816 subtests failed, 99.39% okay. make: *** [test_dynamic] Error 2 /usr/bin/make test -- NOT OK Running make install make test had returned bad status, won't insta

net::dns module

2001-09-20 Thread Vasileios Delis
Hi there trying to understand the module I tried the following example (also in the module'es refrence): use Net::DNS; $res = new Net::DNS::Resolver; $res->debug(1); $query = $res->search($ARGV[0]); if ($query) { foreach $rr ($query->answer) { next un

Re: Net::DNS

2001-07-20 Thread Michael Fowler
of ./ipnew aborted due to compilation errors. This is a bug in Net::DNS, introduced when the defined(@array) syntax became deprecated in recent versions of Perl. Why the author is using defined(@array) I have no idea. I encountered this problem earlier but was too lazy to do anything about it; I

Re: Net::DNS

2001-07-20 Thread charles
2001 [EMAIL PROTECTED] wrote: > hello all- > my script is as follows: > > #!/usr/bin/perl -w > > use strict; > use Net::DNS; > > $res = new Net:DNS::Resolver; > $query = $res->query("216.8.86.8","PTR"); > > if ($query) { > f

Net::DNS

2001-07-20 Thread charles
hello all- my script is as follows: #!/usr/bin/perl -w use strict; use Net::DNS; $res = new Net:DNS::Resolver; $query = $res->query("216.8.86.8","PTR"); if ($query) { foreach $rr ($query->answer) { next unless $rr->type eq "PTR";

RE: Net::DNS::MX data

2001-04-24 Thread Matt Cauthorn
ata from 2 servers use strict; use Net::DNS; Parse the file open IN, "C:/Documents and Settings/mcauthorn/Desktop/perl_crap/zones_final.txt" || die "can't open \n"; my (@lines,@domain_names); @lines=(); chomp @lines; close IN; my %name_servers=(

Re: Perl documentation (Net::DNS::RR::MX)

2001-04-23 Thread Sean O'Leary
ut from the basic info how to use it. > >For instance, I'm interested in being able to do MX lookups via Perl so I >found Net::DNS::RR::MX which appears to be what I'm looking for... I don't know if this is too late or whatever, but take a look at the Net::DNS documentation.

Re: Perl documentation (Net::DNS::RR::MX)

2001-04-22 Thread Matt Cauthorn
Matt - This worked for me from my linux box at work, but not on my home network using win2k...I guess you just need to hit the right server. BTW, I just yanked this from the documentation. #!/usr/bin/perl -w use Net::DNS; $name = 'perl.org'; $res = new Net::DNS::Resolver; @mx = mx($

Re: Perl documentation (Net::DNS::RR::MX)

2001-04-19 Thread Peter Scott
#x27;t figure out from the basic info how to use it. > >For instance, I'm interested in being able to do MX lookups via Perl so I >found Net::DNS::RR::MX which appears to be what I'm looking for... > >METHODS >preference > print "preference = ", $rr->pre

Perl documentation (Net::DNS::RR::MX)

2001-04-19 Thread Matthew Goodell
, I'm interested in being able to do MX lookups via Perl so I found Net::DNS::RR::MX which appears to be what I'm looking for... METHODS preference print "preference = ", $rr->preference, "\n"; Returns the preference for this mail exchange. exchange p