home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
NETWORK
/
ISP
/
bind.4.8.3.lzh
/
BIND483
/
EXAMPLES
/
ch06.canon.perl
next >
Wrap
Text File
|
1994-01-09
|
365b
|
18 lines
#!/usr/bin/perl
# Perl canonicalization filter
#
# Expects one hostname per line, in the first field (a la .rhosts,
# X0.hosts)
require 'sys/socket.ph';
while(<>){
if(($hostname, $null) = split){
($domainname, $aliases, $addrtype, $length, @addrs) =
gethostbyname($hostname);
if($domainname) {s/$hostname/$domainname/;}
}
print;
}