aboutsummaryrefslogtreecommitdiff
path: root/net/bind/files/named.init
diff options
context:
space:
mode:
Diffstat (limited to 'net/bind/files/named.init')
-rw-r--r--net/bind/files/named.init9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/bind/files/named.init b/net/bind/files/named.init
index 7c61b5e2a..312e297fb 100644
--- a/net/bind/files/named.init
+++ b/net/bind/files/named.init
@@ -30,6 +30,10 @@ fix_perms() {
done
}
+no_ipv6() {
+ [ -z "$(ip -6 -o route show default)" ]
+}
+
reload_service() {
rndc -q reload
}
@@ -68,8 +72,11 @@ start_service() {
touch $conf_local_file
+ local args=
+ [ no_ipv6 ] && args="-4"
+
procd_open_instance
- procd_set_param command /usr/sbin/named -u bind -f -c $config_file
+ procd_set_param command /usr/sbin/named -u bind -f $args -c $config_file
procd_set_param file $config_file \
$config_dir/bind.keys \
$named_options_file \