Note: This article was written alongside BIND 10 1.0.0-beta. See this article which covers the major differences to be aware of between 1.0.0-beta, and 1.0.0-rc.
I’ve been an avid BIND 9 administrator for many years, and have found its configuration to be straightforward and the software itself to be reliable and RFC compliant wherever I’ve taken the time to check RFC compliance. My only criticism of BIND 9 was not being able to easily and instantly provision new zones (e.g. requiring an rndc reconfig to add new zones), without the use of DLZ (Dynamically Loadable Zones). DLZ (http://bind-dlz.sourceforge.
BIND 10 will replace BIND 9 and ISC DHCP, and thus BIND 10 comprises processes to handle both authoritative and recursive DNS, as well as DHCPv4 and DHCPv6.
BIND 10 is still in development, and this article has been written around the current release (BIND 10 1.0.0 beta). SQLite is the only supported backend at present (except for DHCPv6 which confusingly supports only MySQL).
I’m sure ISC will release a coherent product as development continues, but in my opinion they have released a confusing and very incomplete beta version of BIND 10. The BIND 10 Guide (http://bind10.isc.org/docs/
I will do my best to give BIND 9 admins an interesting overview of getting BIND 10 up and running on a fresh CentOS install, and will demonstrate some of the features available, basic configuration, architecture of the new software and so on.
Stand by guys – it’s going to be odd. Very odd. I’ll be posting new articles as I learn more about BIND 10, so what you read in this article may be superseded by a later article (once I find a better/correct way of doing something, or BIND 10 itself changes).
Building BIND 10
My BIND 10 testbed is a fresh install of CentOS 6.3 x86_64 inside a Virtual Machine. I selected the Minimal package set, and as such will need to install a few prerequisite packages prior to building BIND 10. Some packages are not provided in the CentOS repositories (and in the case of Python, only Python 2.x is provided and we need Python 3.x), and in those cases I’ll show you how to install those packages too.
If you’re not running CentOS 6.3, check the system-specifc notes page on the BIND 10 wiki (http://bind10.isc.org/wiki/
First, install as many of the prerequisite packages as you can from the CentOS repositories. For building BIND 10, you will need gcc-c++, make, automake, libtool, boost, boost-devel, sqlite-devel. For Python, you’ll also need openssl-devel, bzip-devel, expat-devel, gdbm-devel, readline-devel. Install those packages first via yum.
|
1 2 |
# yum install -y gcc-c++ make automake libtool boost boost-devel sqlite-devel # yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel |
Once all packages have been successfully installed, you can proceed to build the prerequisites that are not supplied within the CentOS package repositories. We will need to do this for Botan (http://botan.randombit.net), log4cplus (http://log4cplus.sourceforge.
Start with Botan. I presume that all source code tarballs have been downloaded to /usr/local/src.
|
1 2 3 4 5 6 7 8 |
# cd /usr/local/src # tar xjf Botan-1.10.4 # cd Botan-1.10.4 # ./configure.py --prefix=/usr/local/botan-1.10.4 # make # make install # ln -s /usr/local/botan-1.10.4 /usr/local/botan # ln -s /usr/local/botan/bin/botan-config-1.10 /usr/local/botan/bin/botan-config |
Next, log4cplus:
|
1 2 3 4 5 6 7 |
# cd /usr/local/src # tar xjf log4cplus-1.1.0.tar.bz2 # cd log4cplus-1.1.0 # ./configure --prefix=/usr/local/log4cplus-1.1.0 # make # make install # ln -s /usr/local/log4cplus-1.1.0 /usr/local/log4cplus |
Finally, Python 3.2 (3.1 also works):
|
1 2 3 4 5 6 7 |
# cd /usr/local/src # tar xjf Python-3.2.3.tar.bz2 # cd Python-3.2.3 # ./configure --prefix=/usr/local/python-3.2.3 # make # make install # ln -s /usr/local/python-3.2.3 /usr/local/python3 |
OK - all our prerequisites are installed and we’re ready to build BIND 10 itself.
|
1 2 3 4 5 6 7 8 9 10 |
# cd /usr/local/src # tar xzf bind10-1.0.0-beta.tar.gz # cd bind10-1.0.0-beta # ./configure --prefix=/usr/local/bind10-1.0.0-beta \ > --with-pythonpath=/usr/local/python3/bin/python3 \ > --with-botan-config=/usr/local/botan/bin/botan-config \ > --with-log4cplus=/usr/local/log4cplus # make # make install # ln -s /usr/local/bind10-1.0.0-beta /usr/local/bind10 |
BIND 10 is now installed and ready for use.
Starting with the Processes
Before starting BIND 10 for the first time, it’s worth reviewing the BIND 10 Guide and understanding the process architecture of BIND 10 and how it differs from BIND 9.
BIND 9 had a single process - named. Depending on your OS and build-time options, this may or may not be a multi-threaded process. In BIND 10, there are a myriad of processes, as the software has been redesigned to be modular - with the bulk of it being written in Python. This is generally a good thing, and the BIND 10 control channel makes managing these processes fairly easy - you don’t have to worry about starting/stopping each of them individually once you’ve configured the BIND 10 Boss process to start them for you (this will all be explained).
Let’s look at the various processes that comprise BIND 10 and learn what they actually do. This is taken verbatim from the BIND 10 Guide - why reinvent the wheel?
-
b10-auth — Authoritative DNS server. This process serves DNS requests.
- b10-cfgmgr — Configuration manager. This process maintains all of the configuration for BIND 10.
- b10-cmdctl — Command and control service. This process allows external control of the BIND 10 system.
- b10-ddns — Dynamic DNS update service. This process is used to handle incoming DNS update requests to allow granted clients to update zones for which BIND 10 is serving as a primary server.
- b10-msgq — Message bus daemon. This process coordinates communication between all of the other BIND 10 processes.
- b10-resolver — Recursive name server. This process handles incoming DNS queries and provides answers from its cache or by recursively doing remote lookups.
- b10-sockcreator — Socket creator daemon. This process creates sockets used by network-listening BIND 10 processes.
- b10-stats — Statistics collection daemon. This process collects and reports statistics data.
- b10-stats-httpd — HTTP server for statistics reporting. This process reports statistics data in XML format over HTTP.
- b10-xfrin — Incoming zone transfer service. This process is used to transfer a new copy of a zone into BIND 10, when acting as a secondary server.
- b10-xfrout — Outgoing zone transfer service. This process is used to handle transfer requests to send a local zone to a remote secondary server.
- b10-zonemgr — Secondary zone manager. This process keeps track of timers and other necessary information for BIND 10 to act as a slave server.
BIND 10: Starting Up
Now that BIND 10 is installed, and we know a little about the processes that may run (not all of them will be running; in fact, when you start BIND 10 for the first time only a few required processes will be running), we can start BIND 10 for the first time. As per the BIND 10 Guide, the <BIND_10_BASE>/sbin/bind10 command is used to start the server - this is the BIND 10 master (Boss) process, and will start all required sub-processes and will restart “some” processes that exit unexpectedly (though the documentation doesn’t make it clear which processes it will restart).
Let’s start out server:
|
1 2 |
# cd /usr/local/bind10/sbin # ./bind10 |
What madness is this - it runs in the foreground, attached to our terminal! /sigh. Even the BIND 10 Guide makes reference to “using another terminal” to perform other tasks while leaving the bind10 process running in the foreground. Obviously this is nonsense, and useless for any real production purposes. For now, observe the log messages outputted to your console, and you’ll see:
|
1 |
2013-01-30 00:43:17.977 INFO [b10-boss.boss/60316] BIND10_STARTUP_COMPLETE BIND 10 started |
BIND 10 is up and running! Hit ^C to shut it back down again - observe the messages until:
|
1 |
2013-01-30 00:43:22.549 INFO [b10-boss.boss/60316] BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete |
For now (until we write an init.d script), you can use bind10 back up using nohup so you can ditch your session if you want to. Another alternative until BIND 10 is daemonised properly is to run it in a screen session. I can’t see the ability to easily chroot BIND 10 at this point either - but a bind10 -h does show a -u option for running BIND 10 as a different user after startup (though it must obviously be started as root so it can bind to port 53 initially before dropping its privileges).
Let’s add a user specifically for BIND 10 (try and make this beta software at least partially secure), and see if it works as expected:
|
1 2 3 4 5 6 7 8 9 10 11 |
# groupadd -g 5353 bind10 # useradd -M -d /dev/null -s /sbin/nologin -u 5353 -g bind10 -c "BIND 10 User" bind10 # cd /usr/local/bind10/sbin # nohup ./bind10 -u bind10 & # tail -f nohup.out # ps -ef | grep '[b]ind10' bind10 7931 7900 1 23:58 pts/0 00:00:00 /usr/local/python3/bin/python3 ./bind10 -u bind10 bind10 7933 7931 0 23:58 pts/0 00:00:00 /usr/local/python3/bin/python3 /usr/local/bind10-1.0.0-beta/libexec/bind10/b10-msgq bind10 7934 7931 0 23:58 pts/0 00:00:00 /usr/local/python3/bin/python3 /usr/local/bind10-1.0.0-beta/libexec/bind10/b10-cfgmgr bind10 7935 7931 0 23:58 pts/0 00:00:00 /usr/local/python3/bin/python3 /usr/local/bind10-1.0.0-beta/libexec/bind10/b10-stats bind10 7936 7931 1 23:58 pts/0 00:00:00 /usr/local/python3/bin/python3 /usr/local/bind10-1.0.0-beta/libexec/bind10/b10-cmdctl |
As you can see all processes are running as the bind10 user, as expected. As well as the bind10 process itself, four additional python3 processes are running (you can refer to the bullet list above to find out what they’re for), and as previously mentioned, no actual DNS/DHCP components are enabled - only the core processes required for messaging and command control within BIND 10 itself are running out-of-the-box.
bindctl and Shutting Down BIND 10
In the beta release of BIND 10, bindctl is the only administrative interface provided to configure and control your BIND 10 server. I’ll provide a cursory introduction to bindctl here, and use it to shut down the BIND 10 server we now have running in the background (if you’re running in the foreground as per the default behaviour - just hit ^C to shut the server down). Later, I will configure bindctl properly and use b10-cmdctl-usermgr to create an account other than the default out-of-the-box root BIND 10 account.
bindctl can be found in <BIND_10_BASE>/bin - which we will use to connect to our server and, in this initial case, shut it down. We haven’t changed any of BIND 10′s port bindings, so it’ll connect to the default address of the b10-cmdctl module - 127.0.0.1:8080. First, let’s verify
|
1 2 3 4 5 |
# netstat -anlp | grep 8080 tcp 0 0 127.0.0.1:8080 0.0.0.0:* LISTEN 7936/python3 # ps -fp7936 UID PID PPID C STIME TTY TIME CMD bind10 7936 7931 0 Jan30 pts/0 00:00:00 /usr/local/python3/bin/python3 /usr/local/bind10-1.0.0-beta/libexec/bind10/b10-cmdctl |
So we can see that b10-cmdctl is indeed listening on port 8080/tcp. Time to connect with bindctl:
|
1 2 3 4 5 6 7 |
# cd /usr/local/bind10/bin # ./bindctl [TEMP MESSAGE]: username :root password :bind10 Username:root Password: ["login success "] > |
As you can see, bindctl spits out “TEMP MESSAGE”, giving us the default credentials to use to connect. Once I start playing with b10-cmdctl-usermgr I’ll see if there is a way of removing this default account and creating a proper (i.e. secure and non-default) administrative account. For now, we know that we want to shut down the Boss process. Type Boss help at the bindctl prompt to receive a list of commands we can issue against the Boss process :
|
1 2 3 4 5 6 7 |
> Boss help Module Boss Master process Available commands: help Get help for module. shutdown Shut down BIND 10 ping Ping the boss process show_processes List the running BIND 10 processes |
Looks like a Boss shutdown will do the trick - let’s try:
|
1 2 3 |
> Boss shutdown > Failed to send request, the connection is closed |
The “Failed to send request message” is expected, as I hit enter when Boss shutdown returned me to the bindctl prompt. Checking our nohup.out:
|
1 2 |
# sed -n '$p' /usr/local/bind10/sbin/nohup.out 2013-01-31 00:19:22.631 INFO [b10-boss.boss/7931] BIND10_SHUTDOWN_COMPLETE all processes ended, shutdown complete |
Perfect - the Boss process (and thus all sub-processes) has been shutdown. We can confirm:
|
1 2 |
# ps -ef | grep -c '[b]ind10' 0 |
We have now seen how to build and install BIND 10, start it up (in the background), get it running as a designated user, connect to the command channel, and issue a command to shut BIND 10 down.
In the next article, I’ll use bindctl to configure BIND 10 to run as an Authoritative DNS Server.
Hello, I’m a developer of BIND 10. Thanks for the write-up; it’s
really encouraging and informative.
I have a quick question about your setup with the backend DB: do you
need to define your own schema for the DB, or is it acceptable to use
a predefined schema just like the way BIND 10 currently does?
Hi,
Thanks for the positive feedback on the article.
I used the default SQLite3 schema and performed no modifications. Any news on when a MySQL backend will be available?
Cheers,
Toki
Ah, sorry, I wasn’t clear enough. My question was about what kind of
operation mode you would need if you used BIND 10 for your production
system, not what you actually did in your initial experiment.
Specifically, I was curious if you’d need to define your own schema
or it’s enough if you first set up a traditional zone file and use
a provided tool like b10-loadzone (in the latter case you’ll use
the schema defined within BIND 10).
As for MySQL support, there’s no fixed date, but we are certainly
planning to support it, and are now trying to figure out which feature
is most important for candidate users so that we can set priorities.
My questions above are an attempt to get such information.
Thanks.
The default schema would be fine for production purposes – although I’ve not attempted zone transfers yet, but presume the default schema can handle this? I normally use PowerDNS, and either provision directly into the MySQL database (using the default schema provided with PowerDNS) or use zone2sql to convert the BIND format zonefile into SQL for loading.
If I was using BIND 10 in a production environment, I’d either provision into the SQL backend directly (and the default schema – provided it supports zone transfers) and use b10-loadzone for any migration.
Some folks may need to modify the default schema, however, and add additional columns that are updated by their provisioning system (to store non-DNS information against each record, say a comment or customer ID).
Okay, thanks. And yes, the default SQLite3 schema supports zone
transfer (both in and out), and so will other SQL backends.
To make installation and testing easier, there are binary installation packages for BIND 10 and dependencies for RedHat EL/CentOS, Debian, MacOS X and Solaris at http://support.menandmice.com/download/bind10
If anything is missing/broken, or someone need a build for a different platform / OS, please let me know
Carsten Strotmann
Thanks for this excellent resource, Carsten - this will make installation far quicker and get people working with BIND 10 with the minimum of fuss.
Many thanks
Toki
P.S. I hold M&M Advanced BIND certification - I was known by a different name back then but you were onsite teaching us Advanced BIND and DNSSEC in Melbourne, Australia.
I have good memories on the training(s) in Melbourne, I always like coming to Australia, esp. Melbourne.
I’m teaching the first BIND 10 training in Amsterdam this week, and there will be a BIND 10 certification in the future. I’m seeing you are already preparing for that