mirror of
https://codeberg.org/h3xx/you-dont-need-pihole.git
synced 2024-08-14 20:27:01 +00:00
Also block IPv6 address lookups
This commit is contained in:
parent
6784ea96c0
commit
3e3e0d48f2
1 changed files with 6 additions and 2 deletions
|
@ -54,7 +54,7 @@ sub add_host_file {
|
||||||
|
|
||||||
MAIN: {
|
MAIN: {
|
||||||
my $out;
|
my $out;
|
||||||
my $block_ip = '0.0.0.0';
|
my $block_ip = '0.0.0.0 ::1';
|
||||||
my $workdir = &dirname($0);
|
my $workdir = &dirname($0);
|
||||||
|
|
||||||
unless (&GetOptions(
|
unless (&GetOptions(
|
||||||
|
@ -82,9 +82,13 @@ MAIN: {
|
||||||
open $fho, '>', $out
|
open $fho, '>', $out
|
||||||
or die "Failed to open file $out for writing: $!";
|
or die "Failed to open file $out for writing: $!";
|
||||||
}
|
}
|
||||||
|
my @block_ip = sort split /\s+/, $block_ip;
|
||||||
print $fho map {
|
print $fho map {
|
||||||
++$written;
|
++$written;
|
||||||
"$block_ip $_\n"
|
my $domain = $_;
|
||||||
|
map {
|
||||||
|
"$_ $domain\n"
|
||||||
|
} @block_ip;
|
||||||
} sort keys %domains;
|
} sort keys %domains;
|
||||||
|
|
||||||
printf STDERR "%d domains written to %s from\n", $written, $out;
|
printf STDERR "%d domains written to %s from\n", $written, $out;
|
||||||
|
|
Loading…
Reference in a new issue