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
, "-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
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
>
> 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
. 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
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
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
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/
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
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
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
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
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
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
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->
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
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;
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
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
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 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"
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
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
> 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
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,
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/
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
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
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
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
> -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,
> >
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
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
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
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
[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,
[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
How would I get all hosts for a particular domain using Net::DNS?
I tried *.domainname in my query.
thanks,
"Wiggins
d
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
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
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
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 ($
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 != ' ' )
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
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
, 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
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
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
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
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
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
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,
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
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
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
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
> 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
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
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
- 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.
> >
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/
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
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
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
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
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";
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=(
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.
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($
#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
, 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
71 matches
Mail list logo