🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.perl
Article #96

Re: Pobieranie informacji z DNS-u

#96
From: Piotr Piatkowski
Date: Thu, 27 Feb 1997 16:47
44 lines
2127 bytes
Pawel Krawczyk <kravietz@pipeta.chemia.pk.edu.pl> wrote:
: In pl.comp.lang.perl Piotr Piatkowski <kompas@galaxy.uci.agh.edu.pl> wrote:

: > Czy przez nazwę kanoniczną rozumiesz CNAME? Jeżeli tak, to się nie da :-)
: > Przynajmniej nie w dopuszalnie krótkim czasie. Problem jest mniej więcej taki 
: > sam, jak z odkowaniam hasła z /etc/passwd :-)

: A jakas gotowa funkcja do zone transferow w perlu?

use Net::DNS;

my $res = new Net::DNS::Resolver;

my @zone = $res->axfr( "uci.agh.edu.pl" );

foreach $rr ( @zone ) {
  if( $rr->type eq "CNAME" && $rr->cname eq "galaxy.uci.agh.edu.pl" ) {
    print $rr->name . "\n";
  }
}


$ ./example
mail.uci.agh.edu.pl
gal.uci.agh.edu.pl
news.uci.agh.edu.pl
nic.uci.agh.edu.pl

Tylko że po pierwsze - kto powiedział że CNAME musi być w tej samej 
domenie, a po drugie - to nie uwzględnia CNAME zagnieżdżonych.

W praktyce żeby znaleźć wszystkie CNAME trzeba by sprawdzić cały DNS,
dlatego napisałem że się nie da :-)

P.S. Oczywiście DNS::Net trzeba sobie ściągnąć, 

ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/modules/by-category/

A oprócz niego potrzebny jest jeszcze IO::Socket (tamże) no i w miarę
nowy perl, np. 5.003_90:
ftp://ftp.pk.edu.pl/pub/lang/perl/CPAN/src/5.0/unsupported/

-- 
Piotr Piątkowski, Uczelniane Centrum Informatyki, AGH Krakow, POLAND
Technical Details
Message-ID: <5f4dqk$h84@galaxy.uci.agh.edu.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!news.man.torun.pl!mat.uni.torun.pl!uw.edu.pl!ict.pwr.wroc.pl!galaxy.uci.agh.edu.pl!galaxy.uci.agh.edu.pl!news
References: <5f3l9m$45l$1@l3xhp.cyf.gov.pl> <5f48fv$7pk@galaxy.uci.agh.edu.pl> <5f4b3i$ruo@info.cyf-kr.edu.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!news.man.torun.pl!mat.uni.torun.pl!uw.edu.pl!ict.pwr.wroc.pl!galaxy.uci.agh.edu.pl!galaxy.uci.agh.edu.pl!news
From: kompas@galaxy.uci.agh.edu.pl (Piotr Piatkowski)
Newsgroups: pl.comp.lang.perl
Subject: Re: Pobieranie informacji z DNS-u
Date: 27 Feb 1997 17:47:16 +0100
Organization: University of Mining & Metallurgy
Lines: 44
Message-ID: <5f4dqk$h84@galaxy.uci.agh.edu.pl>
References: <5f3l9m$45l$1@l3xhp.cyf.gov.pl> <5f48fv$7pk@galaxy.uci.agh.edu.pl> <5f4b3i$ruo@info.cyf-kr.edu.pl>
NNTP-Posting-Host: galaxy.uci.agh.edu.pl
Mime-Version: 1.0
X-Newsreader: TIN [UNIX 1.3 unoff BETA release 960713]
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit