7

So I'm kinda a newbie and I'm following this to connect a domain to my server. here is my codes:

named.conf.options:

acl "trusted" {
        124.243.241.164;
        124.243.241.164;
        124.243.241.164;
        124.243.241.164;
};


options {
    directory "/var/cache/bind";

    recursion yes;                 
    allow-recursion { trusted; };  
    listen-on { 124.243.241.164; };  
    allow-transfer { none; };      

    forwarders {
            8.8.8.8;
            8.8.4.4;
    };


    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};

named.conf.local:

zone "ns1.raze.one" {
        type master;
        file "/etc/bind/zones/db.ns1.raze.one";
        allow-transfer { 124.243.241.164; };
 };
zone "243.124.in-addr.arpa" {
        type master;
        file "/etc/bind/zones/db.124.243";
        allow-transfer { 124.243.241.164; };
 };

db.124.243:

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@   IN  SOA ns1.raze.one. root.ns1.raze.one. (
                  3     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
; name servers - NS records
      IN      NS      ns1.ns1.raze.one.
      IN      NS      ns2.ns2.raze.one.
; PTR Records
164.241   IN      PTR     ns1.ns1.raze.one.    ; 124.243.241.164
164.241   IN      PTR     ns2.ns2.raze.one.    ; 124.243.241.164
164.241   IN      PTR     rdn.mercury.orderbox-dns.com.  ; 124.243.241.164
164.241   IN      PTR     rdn.venus.orderbox-dns.com.  ; 124.243.241.164

db.ns1.raze.one:

;
; BIND data file for local loopback interface
;
$TTL    604800
@   IN  SOA ns1.raze.one. root.ns1.raze.one. (
                  5     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
; name servers - NS records
    IN      NS      ns1.ns1.raze.one.
    IN      NS      ns2.ns1.raze.one.
; name servers - A records
ns1.ns1.raze.one.          IN      A       124.243.241.164
ns2.ns2.raze.one.          IN      A       124.243.241.164

; 124.243.241.164 - A records
rdn.mercury.orderbox-dns.com.        IN      A      124.243.241.164
rdn.venus.orderbox-dns.com.        IN      A      124.243.241.164

Now the problem is when I enter sudo named-checkzone ns1.raze.one db.ns1.raze.one I get this error:

zone ns1.raze.one/IN: loading from master file db.ns1.raze.one failed: file not found
zone ns1.raze.one/IN: not loaded due to errors. 

although this file does exist!
and when I do sudo named-checkzone 124.243.in-addr.arpa /etc/bind/zones/db.124.243 it's working:

zone 124.243.in-addr.arpa/IN: loaded serial 3
OK

I'm stuck at this for while I would appreciate a little help here.

2
  • 1
    You have one command with a relative path that fails with a "file not found" error and one with an absolute path that works, what is the current directory? Commented Oct 2, 2018 at 5:57
  • Did Tom's answer solved your issue? If not, could you edit your question or comment on his answer so the community can help you further?
    – Simba
    Commented Dec 23, 2018 at 19:01

1 Answer 1

6

It's just a wild guess but with the directory statement pointing to /var/cache/bind/ it will search there for the files if you specify a relative path name. Either specify the absolute path as you did, or modify the directory statement.

2
  • 3
    The answer helped me; I'd just add that instead of sudo named-checkzone ns1.raze.one db.ns1.raze.one, it should be sudo named-checkzone /etc/bind/zones/ns1.raze.one db.ns1.raze.one in OP's case (it may be difficult to orient yourself when someone simply says "use absolute paths instead of relative", as I was looking into the confs and not on the command itself). Needless to say, bind9 respects the directory in the configuration file, only the named-checkzone utility doesn't, for some reason.
    – pydoge
    Commented Apr 7, 2019 at 14:22
  • @pydoge: is this still the case? Perhaps you could file a bug report with ISC?
    – Tommiie
    Commented Sep 8, 2021 at 8:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .