Manually create zone files

Issues related to configuring your network
Post Reply
Evans Vic
Posts: 1
Joined: 2017/06/11 17:35:36

Manually create zone files

Post by Evans Vic » 2017/06/11 17:54:14

I've opened up a test account on A2 hosting. It's an unmanaged VPS which means no cpanel. I have fair linux skills and can set up the lamp stack, virtual hosts, etc but I've never set up name servers or zone files.

The first domain I'm using is pointing to A2 name servers but my problem is how to create valid zone file records. I've tried to set up the named.conf file with a link to the domain file in /var/named, then restart named but I get errors, and I'm not even sure this is the right sequence. The other thing I'm not sure about is whether I need to install bind. I assume that because I'm not creating a custom name server that I don't need it.

I've been searching for a good primer on how to do this but am struggling. Here's what I've got so far:


Code: Select all

options {
        listen-on port 53 {; };
        listen-on-v6 port 53 { ::1; };
        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; };
        recursion yes;

        dnssec-enable yes;
        dnssec-validation yes;

        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";

        managed-keys-directory "/var/named/dynamic";

logging {
        channel default_debug {
                file "data/";
                severity dynamic;

zone "." IN {
        type hint;
        file "";

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

zone "" {
        type master;
        file "/var/named/";
Here's the file /var/named/

Code: Select all

$TTL 1440   86400     IN  SOA (
       1           ; serial
       21600       ; refresh after 6 hours
       3600        ; retry after 1 hour
       604800      ; expire after 1 week
       86400 )     ; minimum TTL of 1 day       86400   IN      NS       86400   IN      NS       14400   IN      A

www     14400   IN      CNAME

And here's the output of service named restart:

Code: Select all

Stopping named:                                            [  OK  ]
Starting named: 
Error in named configuration:
zone localhost.localdomain/IN: loaded serial 0
zone localhost/IN: loaded serial 0
zone loaded serial 0
zone loaded serial 0
zone loaded serial 0
zone NS '' has no address records (A or AAAA)
zone NS '' has no address records (A or AAAA)
zone not loaded due to errors.
_default/ bad zone
I'd appreciate any help...

User avatar
Retired Moderator
Posts: 3039
Joined: 2010/12/01 19:25:52
Location: Helsinki, Finland

Re: Manually create zone files

Post by avij » 2017/06/11 20:44:59


Code: Select all       86400   IN      NS       86400   IN      NS
should be

Code: Select all       86400   IN      NS       86400   IN      NS

User avatar
Forum Moderator
Posts: 29430
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Manually create zone files

Post by TrevorH » 2017/06/11 20:57:47

I'd also be pretty sure that 86400 IN SOA (
is missing a full stop from the end of and that ought to be (also with the trailing full stop).
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 6 - Networking Support”