Setting up a Name Server for IPv6 rDNS in CentOS Print

  • Setting, Name, Server, IPv6, rDNS, CentOS
  • 0

Managing your own IPv6 rDNS is a fairly simple task. After setting up the name server, please open a ticket with support to request that the block is delegated to the name servers setup in this article.

In this guide we will show you how to set up a master only and master and slave system for rDNS.

 Start with setting up a master and slave server first:

 1. Log into the your dedicated server as root (or another user with full root privilages).

2. Install bind and bind-utils by executing yum install bind bind-utils from within the console.

3. Back up of the default configuration file by executing cp /etc/named.conf /etc/named.bak within the console.

4. Edit the configuration file by executing vim /etc/named.conf within the console. Below the sample of modified file.

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
        listen-on port 53 { any; };
        listen-on-v6 port 53 { none; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        allow-query     { localhost; any; };
        allow-transfer { none; }; 
        recursion no; 
        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

//This bellow will be our rDNS zone.
zone "B.B.B.B.A.A.A.A.0.8.8.9.5.0.6.2.ip6.arpa." IN {
type master;
file "rdns.zone";
allow-update { none; };
allow-transfer { 2.2.2.2; };
notify yes;
also-notify { 2.2.2.2; };
};

*Notes: The Lines "listen-on port 53 { any; };" and "listen-on-v6 port 53 { none; };" can be set to listen on a specific IP address configured on the server i.e. 1.1.1.1; or 1.1.1.2; etc.

The line zone "B.B.B.B.A.A.A.A.0.8.8.9.5.0.6.2.ip6.arpa." is your /64 IPv6 block in reverse. In this example it represents IPv6 IP block 2605:9880:AAAA.BBBB. 

The IPv6 block assigned by default will be a /64. To encode IPv6 block 2605:9880:0:1 for example, each segment will need to be 4 characters long to take 2605:9880:0:1 and make each segment 4 characters long by adding zeros in front of the front like so 2605:9880:0000:0001. If the IPv6 block is 2605:9880:0:12 then the same rule applies to have 2605:9880:0000:0012.

 Now we take 2605:9880:0000:0012 and enter it backwards adding a '.' after each value to have 2.1.0.0.0.0.0.0.0.8.8.9.5.0.6.2 and append it with '.ip6.arpa.' so you know have the rDNS zone for block  2605:9880:0:12 = 2.1.0.0.0.0.0.0.0.8.8.9.5.0.6.2.ip6.arpa.

'Type' will be set as master as it is the main nameserver.

The 'file' specified here will contain our PTR entries.

The 'allow-transfer' line will allow to transfer settings from the master to a slave if applicable.

If you plan to have only one name server with no master, this line and 'also-notify' can be ignored.

To add a zone record for IPv6 rDNS. Type in the following command: vim /var/named/rdns.zone

The actual zone record Zone Record:

$TTL 1h ; Default TTL
@       IN      SOA     dns1.example.com        admin.example.com. (
        1234567890      ; serial
        1h              ; slave refresh interval
        15m             ; slave retry interval
        1w              ; slave copy expire time
        1h              ; NXDOMAIN cache time
        )
;
; domain name servers
;
@       IN      NS      dns1.example.com.
@       IN      NS      dns2.example.com.
dns1            IN      A               1.1.1.1
dns2            IN      A               2.2.2.2
; IPv6 PTR entries
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.1.0.0.0.0.0.0.0.8.8.9.5.0.6.2.ip6.arpa.    IN    PTR    somesite.com.
2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.1.0.0.0.0.0.0.0.8.8.9.5.0.6.2.ip6.arpa.    IN    PTR    another.somesite.com.

replace 1.1.1.1 with the master IP and 2.2.2.2 with the slave name server IP.

 In this zone file you will see IPs in reverse arpa format. These are part of the PTR records.

To add a record, just put them in reverse arpa format like we did earlier in the config file and append "IN    PTR    domainname"

http://rdns6.com/zone is a useful tool to help create the zone file.

Once created, this zone file needs to be copied to slave name server under the same directory, /var/named in this case.

 The serial number will be important as it will be used to update the entries on both servers.

 To configure the slave server:

 The reset of the setting will be the same but the rDNS zone will be different.

/etc/named.conf

zone "B.B.B.B.A.A.A.A.0.8.8.9.5.0.6.2.ip6.arpa." IN {
type slave;
masters { 1.1.1.1; };
file "rdns.zone";
allow-transfer { 1.1.1.1; };
notify yes;
};

Change the IP 1.1.1.1 of the master server and "B.B.B.B.A.A.A.A.0.8.8.9.5.0.6.2.ip6.arpa." to the reverse IP used in the master config.

Once completed, save and start the service on both the master and the slave server by executing service named start within the console.

 On one of the server you may test the server by executing nslookup ipv6add 1.1.1.1

Replace the "ipv6add" with the ipaddress that you added a PTR report and 1.1.1 to the master server IP, then you can execute the same command but with the slave server IP to make sure it works.

To update the zone file:

 Open the zone file on the master server and add the and extra line and add the PTR record.

Once added you will need to increment the serial by 1 digit and save.

 Once the PTR record has been saved and the serial incremented, execute rdnc reload within the console. This will will update the master and slave server of the added or removed PTR records.

Additional notes:

You can also just have master server. Below is a zone entry in /etc/named.conf for a master only server:

zone "B.B.B.B.A.A.A.A.0.8.8.9.5.0.6.2.ip6.arpa." IN {
type master;
file "rdns.zone";
allow-update { none; };
allow-transfer { none; };
notify yes;
also-notify {none; };
};

 


Was this answer helpful?

« Back