Namedmanager1 is a graphical interface for managing your DNS records. It has been thoughtfully designed to facilitate administration, such as automatically adding PTR records when an A record is created, with a simple checkbox.
The interface can also manage multiple DNS servers and centralize their logs.
If your DNS server is on the same machine as the graphical interface, you’ll need to install it:
1
aptitude install bind9
We’ll need these utilities to make the web interface work:
1
aptitude install bind9utils php-soap
Let’s download the latest version, then extract it:
1
2
3
4
cd /tmp
wget https://projects.jethrocarr.com/p/oss-namedmanager/downloads/get/namedmanager-1.5.1.tar.bz2
tar -xjf namedmanager-1.5.1.tar.bz2
cd namedmanager-1.5.1
We’ll now take care of the web part. Personally, I have a dedicated machine to manage my DNS on which I don’t want virtualhosts. So I put everything at the root of my server, but you don’t have to do like me either. Then we’ll create the configuration file and put it in /etc:
Edit your configuration to have the correct database information:
1
2
3
4
5
6
7
8
9
[...]
/*
Database Configuration
*/$config["db_host"] ="localhost"; // hostname of the MySQL server
$config["db_name"] ="namedmanager"; // database name
$config["db_user"] ="namedmanager"; // MySQL user
$config["db_pass"] ="password"; // MySQL password (if any)
[...]
Before moving on, it’s time to restart all the services that have been modified:
1
2
3
service php5-fpm restart
service nginx restart
service cron restart
We’ll integrate the NamedManager configuration with Bind:
1
2
3
4
5
6
7
8
9
10
11
12
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/etc/bind/named.namedmanager.conf";
Then restart Bind.
Let’s generate an API key (you can use the method you want or do like me):
1
2
> date +%s | sha256sum | base64 | head -c 32 ; echoYmI3ZGRlYWY3NTk4ZDAzMGJmYWE1NDdh
Then edit the following configuration file and adapt it to your needs:
<?php/*
Sample Configuration File
Copy this file to config-settings.php
This file should be read-only to the user whom the bind configuration scripts are running as.
*//*
API Configuration
*/$config["api_url"] ="https://dns.deimos.fr"; // Application Install Location
$config["api_server_name"] ="dns.deimos.fr"; // Name of the DNS server (important: part of the authentication process)
$config["api_auth_key"] ="YmI3ZGRlYWY3NTk4ZDAzMGJmYWE1NDdh"; // API authentication key
/*
Log file to find messages from Named. Note that:
* File should be in syslog format
* Named Manager uses tail -f to read it, this can break with logrotate - make sure that either "copytruncate" mode is used, or tail processes are killed
*/$config["log_file"] ="/var/log/syslog";
/*
Lock File
Used to prevent clashes when multiple instances are accidently run.
*/$config["lock_file"] ="/var/lock/namedmanager_lock";
/*
Bind Configuration Files
Theses files define what files that NamedManager will write to. By design, NamedManager does
not write directly into the master named configuration file, but instead into a seporate file
that gets included - which allows custom configuration and zones to be easily added without
worries of them being over written by NamedManager.
*/$config["bind"]["version"] ="9"; // version of bind (currently only 9 is supported, although others may work)
$config["bind"]["reload"] ="/usr/sbin/rndc reload"; // command to reload bind config & zonefiles
$config["bind"]["config"] ="/etc/bind/named.namedmanager.conf"; // configuration file to write bind config too
$config["bind"]["zonefiledir"] ="/etc/bind/zones"; // directory to write zonefiles too
// note: if using chroot bind, will often be /var/named/chroot/var/named/
$config["bind"]["verify_zone"] ="/usr/sbin/named-checkzone"; // Used to verify each generated zonefile as OK
$config["bind"]["verify_config"] ="/usr/sbin/named-checkconf"; // Used to verify generated NamedManager configuration
// force debugging on for all users + scripts
// (note: debugging can be enabled on a per-user basis by an admin via the web interface)
//$_SESSION["user"]["debug"] = "on";
?>
Go to “User Management”, create a new account and give it admin privileges, test it and delete the setup account or change its password. You should then see only your user:
Why Don’t My Changes Work Even After Restarting Bind? link
Check your logs! If you have messages like:
1
2
3
4
5
6
> tail -50 /var/log/syslog
Apr 14 23:10:01 ZG001187 named[6340]: zone 0.168.192.in-addr.arpa/IN: loading from master file 0.168.192.in-addr.arpa.zone failed: file not found
Apr 14 23:10:01 ZG001187 named[6340]: zone 0.168.192.in-addr.arpa/IN: not loaded due to errors.
Apr 14 23:10:01 ZG001187 named[6340]: zone 255.in-addr.arpa/IN: loaded serial 1Apr 14 23:10:01 ZG001187 named[6340]: zone deimos.fr/IN: loading from master file deimos.fr.zone failed: file not found
Apr 14 23:10:01 ZG001187 named[6340]: zone deimos.fr/IN: not loaded due to errors.
Check your configuration file generated by NamedManager. At the time of writing, I’ve submitted a patch and am waiting for integration, I found myself with this error:
1
2
3
4
5
6
7
8
9
//
// NamedManager Configuration
//
// This file is automatically generated any manual changes will be lost.
//
zone "deimos.fr" IN {type master;
file "deimos.fr.zone"; allow-update { none; };
};
The complete path of the zone file is missing for it to work properly. To fix this issue, modify line 246 of this file: