Click here to get back home

domains, top level, collecting a list of

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
domains, top level, collecting a list of wardbayern 01-29-2008
Get Chitika Premium
Posted by wardbayern on January 29, 2008, 3:37 pm
Please log in for more thread options
Is there a perl way, verses finding a published list, to collect
current top level domain names?

Thanks.

Posted by David Filmer on January 29, 2008, 4:14 pm
Please log in for more thread options
wardbayern@yahoo.com wrote:
> Is there a perl way, verses finding a published list, to collect
> current top level domain names?

http://search.cpan.org/~alexp/Net-Domain-TLD-1.67/lib/Net/Domain/TLD.pm

--
David Filmer (http://DavidFilmer.com)

Posted by John W. Krahn on January 29, 2008, 6:34 pm
Please log in for more thread options
wardbayern@yahoo.com wrote:
> Is there a perl way, verses finding a published list, to collect
> current top level domain names?

$ perl -MSocket -le'
# Search from 1.0.0.1 through 255.255.255.254
for ( my $ip = 16_777_217; $ip < 4_294_967_295; ++$ip ) {
# Skip 127.0.0.0 through 127.255.255.255

next if $ip >= 2_130_706_432 && $ip <= 2_147_483_647;

# Skip 10.0.0.0 through 10.255.255.255 -- RFC1918

next if $ip >= 167_772_160 && $ip <= 184_549_375;

# Skip 172.16.0.0 through 172.31.255.255 -- RFC1918

next if $ip >= 2_886_729_728 && $ip <= 2_887_778_303;

# Skip 192.168.0.0 through 192.168.255.255 -- RFC1918

next if $ip >= 3_232_235_520 && $ip <= 3_232_301_055;



$TLD{ lc( $1 ) }++ if gethostbyaddr( pack( "N", $ip ), AF_INET ) =~
/\.(\w+)\z/;
}
print for sort keys %TLD;
'


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Similar ThreadsPosted
How to use perl to get all of a domains' nameservers. August 2, 2004, 12:35 pm
making cgi-bin dir available to other domains as an alias April 20, 2006, 7:42 am
sharing perl scripts over domains February 2, 2005, 5:32 pm
Setting cookies across multiple domains June 4, 2006, 4:41 am
CGI for collecting phone numbers June 9, 2006, 10:16 am
misc: 4 Millions Domains data with Category November 1, 2004, 4:03 am
deployment of common scripts across multiple domains? January 26, 2005, 10:18 am
Collecting multiple element names using grouptag December 19, 2005, 8:49 am
Collecting details from router, striping info, map and regex. Example. April 10, 2007, 3:29 pm
Deeper level of hashing May 2, 2008, 7:15 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap