On Friday, Nov 14, 2003, at 14:28 US/Pacific, Tim Johnson wrote: [..]
[..]use strict; use warnings;
my @domains = qw(www.x.com x.com www.sandisk.com network.tv funny.co.jp johnson.pictures.geography.info);
foreach(sort @domains){
if($_ =~
/([a-zA-Z0-9\-.]*?)([a-zA-Z0-9\- ]+\.(co\.\w{2}|com|net|edu|gov|info|tv))
$/){
my $host = $1;
my $domain = $2;
$host = "No host " unless $host;
print "$host => $domain\n";
}else{
print "Error: domain name format incorrect!\n";
}
}
My complements on both the code, and the fan out of the RE there.
But there is this minor little problem, the fly in the ointment
nas.nasa.gov
it happens to BE the domain name - yes it is in the 'nasa.gov' name space - but it is it's own domain to which the 'host' component would be the www as in:
www.nas.nasa.gov
This is a part of the reason that trying to pick out the "domain" without getting into the actual DNS level gets to be a bit messy. keeping with just the nas.nasa.gov if you do the standard nslookup query you will find that it returns 198.9.9.7, but if you dig -x 198.9.9.7 you get an A Record for netra07.nas.nasa.gov - this is an old net hack by which the
[EMAIL PROTECTED]
would work the simplest - there would be a machine that actually could pick up and pass the smtp connection traffic...
ciao drieux
---
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]