/usr/bin/hostbyname is in squidguard 1.5-6.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/usr/bin/perl -w
# By Pål Baltzersen Feb, 2000
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (version 2) as
# published by the Free Software Foundation. It is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY; without even
# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU General Public License (GPL) for more details.
# Hostbyname takes a squidGuard domain or url list and does some half
# harted effort to expand it with the corresponding IP-addresses.
# Usage:
# hostbyname < urls > urls.new
# hostbyname < domains > domains.new
my $version = "0.0.1";
use strict;
use Socket;
my ($hostname, $url, $h, $i, $a);
my ($name,$aliases,$addrtype,$length,@addrs);
while(<>) {
my %seen;
chomp;
$url = $_;
$hostname = $_;
$hostname =~ s/\057.*//;
$url =~ s/^$hostname//;
print "$hostname$url\n";
next if($hostname =~ /^\d.\d.\d.\d$/);
foreach $h ($hostname, "www.$hostname", "ftp.$hostname") {
#print "-> $h\n";
($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($h);
#print "-> $name\n";
foreach $i (@addrs) {
$a = inet_ntoa($i);
#print "-> $a\n";
next if($seen{$a});
$seen{$a} = 1;
print "$a$url\n";
}
}
}
|