|Linux 12 March 2014 -|
After successful automatic distribution of IPv6 address information via DHCPv6 in your local network it might be time to start offering some more services. Usually, we would use host names in order to communicate with other machines instead of their bare IPv6 addresses. During the following paragraphs we are going to enable our own DNS name server with IPv6 address resolving.
This is the third article in a series on IPv6 configuration:
Piece of advice: This is based on my findings on the internet while reading other people's helpful articles and going through a couple of man-pages on my local system.
What's your name and your IPv6 address?
If the service is not recognised, you have to install it first on your system. This is done very easy and quickly like so:
Once again, there is no specialised package for IPv6. Just the regular application is good to go.
But of course, it is necessary to enable IPv6 binding in the options. Let's fire up a text editor and modify the configuration file.
Most important directive is the listen-on-v6. This will enable your named to bind to your IPv6 addresses specified on your system. Easiest is to specify any as value, and named will bind to all available IPv6 addresses during start. More details and explanations are found in the man-pages of named.conf.
Save the file and restart the named service. As usual, check your log files and correct your configuration in case of any logged error messages. Using the netstat command you can validate whether the service is running and to which IP and IPv6 addresses it is bound to, like so:
Sweet! Okay, now it's about time to resolve host names and their assigned IPv6 addresses using our own DNS name server.
Alright, our newly configured BIND named is fully operational.
Eventually, you might be more familiar with the dig command. Here is the same kind of IPv6 host name resolve but it will provide more details about that particular host as well as the domain in general.
More details on the Berkeley Internet Name Domain (bind) daemon and IPv6 are available in Chapter 22.1 of Peter Bieringer's HOWTO on IPv6.
Setting up your own DNS zone
Now, that we have an operational named in place, it's about time to implement and configure our own host names and IPv6 address resolving. The general approach is to create your own zone database below the bind folder and to add AAAA records for your hosts. In order to achieve this, we have to define the zone first in the configuration file named.conf.local.
Here we specify the location of our zone database file. Next, we are going to create it and add our host names, our IP and our IPv6 addresses.
With a couple of machines in place, it's time to reload that new configuration.
Note: Each time you are going to change your zone databases you have to modify the serial information, too. Named loads the plain text zone definitions and converts them into an internal, indexed binary format to improve lookup performance. If you forget to change your serial then named will not use the new records from the text file but the indexed ones. Or you have to flush the index and force a reload of the zone.
This can be done easily by either restarting the named:
or by reloading the configuration file using the name server control utility - rndc:
Check your log files for any error messages and whether the new zone database has been accepted. Next, we are going to resolve a host name trying to get its IPv6 address like so:
Alternatively, you could have just ping'd the system as well using the ping6 command instead of the regular ping:
That also looks promising to me. How about your configuration?
Next, it might be interesting to extend the range of available services on the network. One essential service would be to have web sites at hand.