This is an old revision of the document!
Table of Contents
VHFFS uses MyDNS-NG as DNS server, which works with a database to read domain name configuration.
MyDNS-NG is not Debian packaged, you can grab the latest package for your architecture from http://download.tuxfamily.org/vhffs4/debian/pool/main/mydns/ and install it.
wget "http://download.tuxfamily.org/vhffs4/debian/pool/main/mydns/mydns-pgsql_220.127.116.11-2_amd64.deb" dpkg -i mydns-pgsql_18.104.22.168-1_amd64.deb
Server using the main VHFFS database, "primary"
Copy the example configuration file:
Open the file and modify following lines:
db-host = localhost # SQL server hostname db-user = vhffs # SQL server username db-password = password # SQL server password database = vhffs # MyDNS database name allow-tcp = yes # Should TCP be enabled? soa-table = vhffs_dns_soa # Name of table containing SOA records rr-table = vhffs_dns_rr # Name of table containing RR data
Server using a copy of the VHFFS database, "secondary"
Using a VHFFS replicated PostgreSQL database
After PostgreSQL replication is configured, just follow the “primary” DNS server install.
Using the mirror script
Copy the DNS mirror script in some place.
cp /usr/share/vhffs/backend/mirror/mydns-mirror.pl /usr/local/sbin/ chmod o-rwx /usr/local/sbin/mydns-mirror.pl chmod ug+x /usr/local/sbin/mydns-mirror.pl
Create the PostgreSQL secondary DNS database and structures
su - postgres -c "createuser -P ns2" su - postgres -c "createdb -O ns2 ns2" psql ns2 ns2 -h localhost ns2=> \i /usr/share/vhffs/backend/mirror/mydns-mirror.sql
mydns-mirror.pl script to modify connection fields to both master and slave SQL servers.
Install required dependencies:
apt-get install libdbd-pg-perl
Modify your firewall or anything necessary so that the slave server can connect to the master server.
Then run the
mydns-mirror.pl script, it should work
Finally, you have to configure the MyDNS server on the secondary host using the secondary database in the same way we did to the primary server.
Of course, you need to run from time to time the
mydns-mirror.pl script to update the PostgreSQL database, we let you add the necessary cron entry.
Read the tutorial