Change Unbound configuration for openvpn integration

This commit is contained in:
randomshell 2018-09-14 22:28:16 +02:00
parent e78400af7d
commit 6bea1dd6b2

View file

@ -795,7 +795,9 @@ function installLocalDNS () {
apt-get install -y unbound apt-get install -y unbound
# Configuration # Configuration
echo 'hide-identity: yes echo 'interface: 10.8.0.1
access-control: 10.8.0.1/24 allow
hide-identity: yes
hide-version: yes hide-version: yes
use-caps-for-id: yes use-caps-for-id: yes
prefetch: yes' >> /etc/unbound/unbound.conf prefetch: yes' >> /etc/unbound/unbound.conf
@ -811,6 +813,8 @@ prefetch: yes' >> /etc/unbound/unbound.conf
yum install -y unbound yum install -y unbound
# Configuration # Configuration
sed -i 's|# interface: 0.0.0.0|interface: 10.8.0.1' /etc/unbound/unbound.conf
sed -i 's|# access-control: 127.0.0.0/8 allow|access-control: 10.8.0.1/24 allow' /etc/unbound/unbound.conf
sed -i 's|# hide-identity: no|hide-identity: yes|' /etc/unbound/unbound.conf sed -i 's|# hide-identity: no|hide-identity: yes|' /etc/unbound/unbound.conf
sed -i 's|# hide-version: no|hide-version: yes|' /etc/unbound/unbound.conf sed -i 's|# hide-version: no|hide-version: yes|' /etc/unbound/unbound.conf
sed -i 's|use-caps-for-id: no|use-caps-for-id: yes|' /etc/unbound/unbound.conf sed -i 's|use-caps-for-id: no|use-caps-for-id: yes|' /etc/unbound/unbound.conf
@ -826,6 +830,8 @@ prefetch: yes' >> /etc/unbound/unbound.conf
dnf install -y unbound dnf install -y unbound
# Configuration # Configuration
sed -i 's|# interface: 0.0.0.0|interface: 10.8.0.1' /etc/unbound/unbound.conf
sed -i 's|# access-control: 127.0.0.0/8 allow|access-control: 10.8.0.1/24 allow' /etc/unbound/unbound.conf
sed -i 's|# hide-identity: no|hide-identity: yes|' /etc/unbound/unbound.conf sed -i 's|# hide-identity: no|hide-identity: yes|' /etc/unbound/unbound.conf
sed -i 's|# hide-version: no|hide-version: yes|' /etc/unbound/unbound.conf sed -i 's|# hide-version: no|hide-version: yes|' /etc/unbound/unbound.conf
sed -i 's|# use-caps-for-id: no|use-caps-for-id: yes|' /etc/unbound/unbound.conf sed -i 's|# use-caps-for-id: no|use-caps-for-id: yes|' /etc/unbound/unbound.conf
@ -852,8 +858,8 @@ prefetch: yes' >> /etc/unbound/unbound.conf
echo 'server: echo 'server:
root-hints: root.hints root-hints: root.hints
auto-trust-anchor-file: trusted-key.key auto-trust-anchor-file: trusted-key.key
interface: 127.0.0.1 interface: 10.8.0.1
access-control: 127.0.0.1 allow access-control: 10.8.0.1/24 allow
port: 53 port: 53
do-daemonize: yes do-daemonize: yes
num-threads: 2 num-threads: 2