语法和RNDC绑定错误

时间:2015-10-28 15:07:13

标签: linux dns ubuntu-14.04 named bind9

我正在尝试做什么:

尝试创建将解析本地地址和公共地址的绑定DNS服务。我需要能够解析远程位置的内部本地地址。这些遥控器通过代理攻击我们的网络,我正在尝试在该代理服务器上安装绑定服务器。

我正在使用bind9(根据我读过的内容)将允许我使用视图通过acl引导DNS请求。

发生了什么:

我有以下配置报告了许多语法错误,并且rndc连接失败错误会停止DNS。

文件: named.conf.local

acl internals {
    x.x.x.x/8; (local)
    192.168.1.0/24;
);

// Custom Zones for SERVER
view "internal" {
    match-clients { internals; };
    zone "SERVER" {
        type master;
            file "/etc/bind/internal/db.SERVER";
    };
};

view "external" {
    match-clients { any: };
    zone "SERVER" {
        type master;
        file "/etc/bind/external/db.SERVER";
    };
};
来自syslog的

错误:

Oct 28 10:29:22 SERVER named[15228]: loading configuration from '/etc/bind/named.conf'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:7: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:7: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:8: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:9: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:9: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:10: missing ';' before 'master'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:11: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:15: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:15: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:16: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:16: missing ';' before '}'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:17: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:17: missing ';' before '{'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:18: missing ';' before 'master'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf.local:19: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf:12: missing ';' before '"'
Oct 28 10:29:22 SERVER named[15228]: /etc/bind/named.conf:13: expected IP match list element near end of file
Oct 28 10:29:22 SERVER named[15228]: loading configuration: unexpected token
Oct 28 10:29:22 SERVER named[15228]: exiting (due to fatal error)

我需要知道的是:

显然我有些不对劲,我只需要知道我搞砸了哪里。我需要知道语法上是否存在错误,或者我是否使用正确的工具来创建绑定服务器。

TL; DR:

鉴于上面的配置文件和错误是什么导致问题?

1 个答案:

答案 0 :(得分:1)

看起来好像右括号标记')'是第4行的语法错误,它应该是一个结束括号'}'。

当有人发现很难发现某些类似于这些语法错误消息的确切原因时,最好开始切断部分输入文件(在本例中为配置文件)。通过这种方式,您可以找到引入第一个错误的位置,通常可以更容易地发现问题。