大网数据广告活动
服务器运维问答

bind: loading from master file failed: file not found

· 52CE 我爱测

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…

问题原文

原帖链接 · adam west · CC BY-SA 4.0

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.

社区高分解答

原帖链接 · Tommiie · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-10-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。