Providing IPv6 DNS resolver data with radvd

One nagging issue I had with IPv6 was how to distribute DNS server addresses and search lists to my clients.   It took a little research to find the solution.  On IPv4 I had been using DHCP to do this, but DHCP didn’t seem to be right approach for IPv6. radvd can be used to distribute both types of data.  The following article covers setup on Ubuntu and OpenWRT.  The Ubuntu (Debian) examples below should work with any distribution using/etc//radvd.conf to configure radvd.

The specification for these services is in RFC 6106 – IPv6 Router Advertisement Options for DNS Configuration.  This obsoletes RFC5006 – IPv6 Router Advertisement Option for DNS Configuration which only covered RDNSS.

Distributing DNS server addresses

radvd has supported configuration of RDNSS (Recursive DNS Server) announcements for quite a while.  I haven’t encountered a version which doesn’t support RDNSS.   The configuration is well documented, and the default lifetime parameter is appropriate and shouldn’t need to be adjusted..

Configuring the name servers on is done by adding an RDNSS stanza to each interface configuration.  In most cases you will want to use the same DNS servers for all interfaces specified in your radvd.conf file.  For Ubuntu add a stanza like the following using your DNS server addresses.

        RDNSS 2001:db8:1::4 2001:db8:2::5
        {
                # AdvRDNSSLifetime 3600;
        };

For OpenWRT, radvd is configured in /etc/config/radvd.  Like Ubuntu you will need to configure RDNSS for each interface.   The above example is specified as follows:

config rdnss
        option interface        'lan'
        list   addr             '2001:db8:1::4'
        list   addr             '2001:db8:2::5'
        # option AdvRDNSSLifetime 3600
        option ignore           0

Once you have modified your configuration, restart your radvd daemon to begin broadcasting your RDNSS data.

Distributing a DNS search list

Recent versions of radvd support DNSSL (DNS Search List) announcements.  On Ubuntu prior to Natty and the current release of OpenWRT (prior to October 2011) you will need to update to a newer release of radvd.  The specification for DNSSL is very new, so some hosts may not use this data  However, if the data is not broadcast, it can’t be used.  radvd release 1.7 (Jan 12, 2011) is the first release to support DNSSL announcements.

My server runs Ubuntu Lucid for which the distributed radvd does not support DNSSL configuration.  I downloaded the radvd package for Natty which does support DNSSL announcements.  (radvd release 1.7 is the first release to support DNSSL)  It has the same dependencies as the Lucid package so can be installed easily.

Like RDNSS you will need to add a DNSSL stanza to each interface.  If your interfaces belong to different domains, you may want to have different search lists on each interface.  Like RDNSS the default lifetime parameter is appropriate and shouldn’t need adjustment.  Configuring DNSSL for a radvd daemon which does not support it will cause it to fail.  If your radvd daemon supports DNSSL announcements use a  stanza like this:

        DNSSL example.com com ca
        {
                # AdvDNSSLLifetime 3600;
        };

OpenWRT’s configuration ignores unused configuration items so it is possible to configure DNSSL even if your radvd server does not support it.  Add the stanza(s) to /etc/config/radvd in the same manner as for RDNSS.   This configuration should generate the same data as the above configuration does.

config dnssl
        option interface    'lan'
        list   suffix       'example.com'
        list   suffix       'com'
        list   suffix       'ca'
        option ignore       0

Once you have modified your configuration you will need to restart your daemon.

Notes:

The above examples use values intended for documentation purposes only.  You will need to replace the IP addresses and search list suffixes with your own values.

OpenWrt’s radvd daemon can be configured to use a standard /etc/radvd.conf file for configuration.  Doing so may cause failures as noted for the Ubuntu daemons.   If you wish to use your own radvd.conf add the following to your /etc/config/radvd file:

config 'radvd'
        option 'config_file' '/etc/radvd.conf'

DNS search lists and server lists can also be distributed using an avahi (Zeroconf) daemon.  This daemon will also provide some local DNS services similar to those available from some DHCP servers.

radvd version 1.7 added a -c option to check the /etc/radvd.conf configuration file. This can be used to test for problems before restarting the daemon.