Last active
May 1, 2019 01:27
-
-
Save avigail-oron/87f9452c369aa74a0433ad1aec9a2e1c to your computer and use it in GitHub Desktop.
Installing AtomiaDNS Nameserver (PowerDNS) and Synchronizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Install on an Ubuntu machine (I used 16.04) | |
sudo su | |
//Add the Atomia APT Repository: | |
wget -q -O - http://public.apt.atomia.com/setup.sh.shtml | sed s/%distcode/`lsb_release -c | awk '{ print $2 }'`/g | sh | |
//Install the database schema (will also install MySQL): | |
apt-get install atomiadns-powerdns-database | |
//Install perl and perl mysql driver | |
sudo apt-get install libcgi-session-perl | |
apt-get install libdbd-mysql-perl | |
//To configure the nameserver to sync zones from your Atomia DNS installation, add to /etc/atomiadns.conf: | |
soap_uri = http://10.0.0.75/atomiadns | |
soap_username = a@b.com | |
soap_password = 1234 | |
servername = powerdns_db1 | |
//Install the PowerDNS sync agent: | |
apt-get install atomiadns-powerdnssync | |
//Important! to overcome a bug they have, replace the /usr/share/perl5/Atomia/DNS/PowerDNSDatabase.pm file contents | |
//with the contents of my gist called PowerDNSDatabase | |
//If Atomia-web was not installed, run the following on the Atomia API server machine (trusted): | |
atomiadnsclient --method AddNameserverGroup --arg default | |
//Add the nameserver as subscriber of the zones: | |
atomiapowerdnssync add_server default | |
//Create a systemd service file for atomia-sync (exiting service is not compatible with ubuntu version) | |
nano /etc/systemd/system/atomia-sync.service | |
//paste the following in the file: | |
[Unit] | |
Description=Atomia sync to PowerDNS | |
[Service] | |
Type=simple | |
# (NOTE: "Type=simple" is the default) | |
ExecStart=/usr/bin/atomiapowerdnssync updated 2>&1 | logger -t atomiapowerdnssync_updated | |
//Launch the service and check its status (make sure it's not complaining on missing packages): | |
systemctl start atomia-sync | |
systemctl status atomia-sync | |
//Sync all zones: DOESN'T WORK YET!! | |
atomiapowerdnssync full_reload_online | |
// Install PowerDNS (apt-get install brings an old and buggy version, so use this method instead:) | |
// When it asks if you want to replace /etc/powerdns/pdns.conf, | |
// just press enter to keep the version that atomiadns-powerdns-database preconfigured for you | |
// Create the file '/etc/apt/sources.list.d/pdns.list' with this content: | |
deb [arch=amd64] http://repo.powerdns.com/ubuntu xenial-auth-41 main | |
// Create the file /etc/apt/preferences.d/pdns with this content: | |
Package: pdns-* | |
Pin: origin repo.powerdns.com | |
Pin-Priority: 600 | |
// Execute this command | |
curl https://repo.powerdns.com/FD380FBB-pub.asc | sudo apt-key add - && | |
sudo apt-get update && | |
sudo apt-get install pdns-server | |
apt-get install pdns-backend-mysql | |
// Restart pdns service | |
service pdns stop | |
service pdns start | |
//Check if launched OK: | |
service pdns status | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment