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:

/etc/named:

Code: Select all

options {
        listen-on port 53 { 127.0.0.1; };
        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/named.run";
                severity dynamic;
        };
};

zone "." IN {
        type hint;
        file "named.ca";
};

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

zone "cwrdigitalproto2.com" {
        type master;
        file "/var/named/cwrdigitalproto2.com.db";
};
~                                        
Here's the file /var/named/cwrdigitalproto.com.db:

Code: Select all

$TTL 1440

cwrdigitalproto2.com.   86400     IN  SOA dns1.name-services.com webmaster@cwrdigital.com (
       1           ; serial
       21600       ; refresh after 6 hours
       3600        ; retry after 1 hour
       604800      ; expire after 1 week
       86400 )     ; minimum TTL of 1 day

cwrdigitalproto2.com.       86400   IN      NS      dns1.name-services.com
cwrdigitalproto2.com.       86400   IN      NS      dns2.name-services.com

cwrdigitalproto2.com.       14400   IN      A       68.66.193.111

www     14400   IN      CNAME   cwrdigitalproto2.com.

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 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa/IN: loaded serial 0
zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0
zone 0.in-addr.arpa/IN: loaded serial 0
zone cwrdigitalproto2.com/IN: NS 'dns1.name-services.com.cwrdigitalproto2.com' has no address records (A or AAAA)
zone cwrdigitalproto2.com/IN: NS 'dns2.name-services.com.cwrdigitalproto2.com' has no address records (A or AAAA)
zone cwrdigitalproto2.com/IN: not loaded due to errors.
_default/cwrdigitalproto2.com/IN: bad zone
                                                           [FAILED]
I'd appreciate any help...

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

Re: Manually create zone files

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

This

Code: Select all

cwrdigitalproto2.com.       86400   IN      NS      dns1.name-services.com
cwrdigitalproto2.com.       86400   IN      NS      dns2.name-services.com
should be

Code: Select all

cwrdigitalproto2.com.       86400   IN      NS      dns1.name-services.com.
cwrdigitalproto2.com.       86400   IN      NS      dns2.name-services.com.

User avatar
TrevorH
Site Admin
Posts: 33202
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
cwrdigitalproto2.com. 86400 IN SOA dns1.name-services.com webmaster@cwrdigital.com (
is missing a full stop from the end of dns1.name-services.com and that webmaster@cwrdigital.com ought to be webmaster.cwrdigital.com. (also with the trailing full stop).
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply