Debian 9 w/PDNS

8 Aug

apt-get install openssh-server
nano /etc/ssh/sshd_config

if using proxmox:
apt-get install qemu-guest-agent

if using esxi:
apt-get install open-vm-tools

apt-get install htop vnstat net-tools ntp locate apt-transport-https

may be optional depending on your virtualization flavor:
echo blacklist i2c_piix4 >> /etc/modprobe.d/blacklist.conf
update-initramfs -u -k all

if using proxmox:
apt-get install lsb-release

wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php7.3.list

apt-get update

apt-get install apache2 mariadb-server php7.3 php7.3-mysql php7.3 php7.3-json php-apcu

mysql_secure_installation

mkdir -p /var/vhosts/nsX.domain.tld/

cd /tmp
wget https://dl.pdnsmanager.org/pdnsmanager-2.0.1.tar.gz
tar xzf pdnsmanager-2.0.1.tar.gz
cd pdnsmanager-2.0.1
cp -R * /var/vhosts/nsX.domain.tld/

nano /etc/apache2/sites-available/nsX.domain.tld.conf


 
ServerAdmin email@emailaddress.com
ServerName nsX.domain.tld

DocumentRoot "/var/vhosts/nsX.domain.tld/frontend"


Require all granted



RewriteEngine On
RewriteRule ^index\.html$ - [L]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule !^/api/\.* /index.html [L]

Alias /api /var/vhosts/nsX.domain.tld/backend/public


RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

 


chown -R www-data:www-data /var/vhosts
a2enmod rewrite

a2ensite nxX.domain.tld

service apache2 restart

mysql -u root -p

CREATE DATABASE pdns;
GRANT ALL PRIVILEGES ON pdns.* To 'pdns'@'%' IDENTIFIED BY 'password';
quit;

http://ip-address/setup

apt-get install pdns-server pdns-backend-mysql

select >>> NO

cp /etc/powerdns/pdns.conf /etc/powerdns/pdns.conf.original

rm /etc/powerdns/pdns.conf
nano /etc/powerdns/pdns.conf

allow-axfr-ips=
allow-recursion=127.0.0.1
config-dir=/etc/powerdns
daemon=yes
disable-axfr=no
guardian=yes
local-address=0.0.0.0
local-port=53
master=yes
slave=yes
module-dir=/usr/lib/x86_64-linux-gnu/pdns
setgid=pdns
setuid=pdns
socket-dir=/var/run
version-string=powerdns
include-dir=/etc/powerdns/pdns.d

cp /etc/powerdns/pdns.d/bind.conf /etc/powerdns/pdns.d/bind.conf.original
rm /etc/powerdns/pdns.d/bind.conf

cp /etc/powerdns/pdns.d/pdns.local.gmysql.conf /etc/powerdns/pdns.d/pdns.local.gmysql.original
rm /etc/powerdns/pdns.d/pdns.local.gmysql.conf

nano /etc/powerdns/pdns.d/pdns.local.gmysql.conf

launch=gmysql

gmysql-host=localhost
gmysql-port=3306
gmysql-dbname=pdns
gmysql-user=pdns
gmysql-password=password
gmysql-dnssec=no

service pdns restart

hostnamectl set-hostname nsX.domain.tld

5 thoughts on “Debian 9 w/PDNS

Leave a Reply

Your email address will not be published.