aboutsummaryrefslogtreecommitdiffstats
path: root/config/bind/bind.inc
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-10-10 00:41:08 -0300
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-10-10 00:41:08 -0300
commitb46cdd37023fccc545db507b939f70bf8af7f7a0 (patch)
tree97973314db94866396917fe235a352b205406e0b /config/bind/bind.inc
parentf6ab777ce082677fbdb7bb4bd972f347628c556f (diff)
downloadpfsense-packages-b46cdd37023fccc545db507b939f70bf8af7f7a0.tar.gz
pfsense-packages-b46cdd37023fccc545db507b939f70bf8af7f7a0.tar.bz2
pfsense-packages-b46cdd37023fccc545db507b939f70bf8af7f7a0.zip
bind - add rate limit option
Diffstat (limited to 'config/bind/bind.inc')
-rw-r--r--config/bind/bind.inc17
1 files changed, 15 insertions, 2 deletions
diff --git a/config/bind/bind.inc b/config/bind/bind.inc
index d1ff106f..4e01214a 100644
--- a/config/bind/bind.inc
+++ b/config/bind/bind.inc
@@ -72,7 +72,20 @@ $bind_conf .= <<<EOD
max-cache-size $ram_limit;\n
EOD;
-
+ // check response rate limit option
+ //https://kb.isc.org/article/AA-01000/0/A-Quick-Introduction-to-Response-Rate-Limiting.html
+ //http://ss.vix.su/~vjs/rl-arm.html
+ if ($bind['rate_enabled']=="on"){
+ $rate_limit=($bind['rate_limit']?$bind['rate_limit']:"15");
+ $log_only=($bind['log_only']=="no"?"no":"yes");
+ $bind_conf .= <<<EOD
+ rate-limit {
+ responses-per-second {$rate_limit};
+ log-only {$log_only};
+ };
+
+EOD;
+ }
//check ips to listen on
if (preg_match("/All/",$bind['listenon'])){
$bind_listenonv6="Any;";
@@ -97,7 +110,7 @@ EOD;
}
$bind_listenonv6=($bind_listenonv6==""?"none;":$bind_listenonv6);
$bind_listenon=($bind_listenon==""?"none;":$bind_listenon);
- print "<PRE>$bind_listenonv6 $bind_listenon";
+ //print "<PRE>$bind_listenonv6 $bind_listenon";
if (key_exists("ipv6allow",$config['system'])){
$bind_conf .="\t\tlisten-on-v6 { $bind_listenonv6 };\n";
}