mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-22 02:17:26 +00:00
Configure nsd listening interfaces before installing nsd so that it does not interfere with bind9
This commit is contained in:
parent
f534a530d4
commit
8cb360fe36
46
setup/dns.sh
46
setup/dns.sh
@ -10,17 +10,13 @@
|
|||||||
source setup/functions.sh # load our functions
|
source setup/functions.sh # load our functions
|
||||||
source /etc/mailinabox.conf # load global vars
|
source /etc/mailinabox.conf # load global vars
|
||||||
|
|
||||||
# Install the packages.
|
|
||||||
#
|
|
||||||
# * nsd: The non-recursive nameserver that publishes our DNS records.
|
|
||||||
# * ldnsutils: Helper utilities for signing DNSSEC zones.
|
|
||||||
# * openssh-client: Provides ssh-keyscan which we use to create SSHFP records.
|
|
||||||
echo "Installing nsd (DNS server)..."
|
|
||||||
apt_install nsd ldnsutils openssh-client
|
|
||||||
|
|
||||||
# Prepare nsd's configuration.
|
# Prepare nsd's configuration.
|
||||||
|
# We configure nsd before installation as we only want it to bind to some addresses
|
||||||
|
# and it otherwise will have port / bind conflicts with bind9 used as the local resolver
|
||||||
mkdir -p /var/run/nsd
|
mkdir -p /var/run/nsd
|
||||||
|
mkdir -p /etc/nsd
|
||||||
|
mkdir -p /etc/nsd/zones
|
||||||
|
touch /etc/nsd/zones.conf
|
||||||
|
|
||||||
cat > /etc/nsd/nsd.conf << EOF;
|
cat > /etc/nsd/nsd.conf << EOF;
|
||||||
# Do not edit. Overwritten by Mail-in-a-Box setup.
|
# Do not edit. Overwritten by Mail-in-a-Box setup.
|
||||||
@ -42,18 +38,6 @@ server:
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Add log rotation
|
|
||||||
cat > /etc/logrotate.d/nsd <<EOF;
|
|
||||||
/var/log/nsd.log {
|
|
||||||
weekly
|
|
||||||
missingok
|
|
||||||
rotate 12
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
notifempty
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Since we have bind9 listening on localhost for locally-generated
|
# Since we have bind9 listening on localhost for locally-generated
|
||||||
# DNS queries that require a recursive nameserver, and the system
|
# DNS queries that require a recursive nameserver, and the system
|
||||||
# might have other network interfaces for e.g. tunnelling, we have
|
# might have other network interfaces for e.g. tunnelling, we have
|
||||||
@ -70,6 +54,26 @@ echo "include: /etc/nsd/nsd.conf.d/*.conf" >> /etc/nsd/nsd.conf;
|
|||||||
# now be stored in /etc/nsd/nsd.conf.d.
|
# now be stored in /etc/nsd/nsd.conf.d.
|
||||||
rm -f /etc/nsd/zones.conf
|
rm -f /etc/nsd/zones.conf
|
||||||
|
|
||||||
|
# Add log rotation
|
||||||
|
cat > /etc/logrotate.d/nsd <<EOF;
|
||||||
|
/var/log/nsd.log {
|
||||||
|
weekly
|
||||||
|
missingok
|
||||||
|
rotate 12
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
notifempty
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Install the packages.
|
||||||
|
#
|
||||||
|
# * nsd: The non-recursive nameserver that publishes our DNS records.
|
||||||
|
# * ldnsutils: Helper utilities for signing DNSSEC zones.
|
||||||
|
# * openssh-client: Provides ssh-keyscan which we use to create SSHFP records.
|
||||||
|
echo "Installing nsd (DNS server)..."
|
||||||
|
apt_install nsd ldnsutils openssh-client
|
||||||
|
|
||||||
# Create DNSSEC signing keys.
|
# Create DNSSEC signing keys.
|
||||||
|
|
||||||
mkdir -p "$STORAGE_ROOT/dns/dnssec";
|
mkdir -p "$STORAGE_ROOT/dns/dnssec";
|
||||||
|
Loading…
Reference in New Issue
Block a user