linux - conf 上的语法和 RNDC 绑定(bind)错误

标签 linux dns ubuntu-14.04 named bind9

<分区>

我正在尝试做的事情:

尝试创建一个绑定(bind) DNS 服务来解析本地地址和公共(public)地址。我需要能够解析远程位置的内部本地地址。这些 Remote 通过代理访问我们的网络,我正在尝试在该代理服务器上安装绑定(bind)服务器。

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

发生了什么:

我有以下配置,它报告了一些语法错误和一个停止 DNS 的 rndc 连接失败错误。

文件: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";
    };
};

错误: 来自系统日志

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)

我需要知道的:

显然我有问题,我只需要知道我哪里搞砸了。我需要知道语法上是否有问题,或者我是否没有使用正确的工具来创建绑定(bind)服务器。

长话短说:

鉴于上述配置文件和错误,导致问题的原因是什么?

最佳答案

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

当有人发现难以理解这些无法解释的语法错误消息的确切原因时,开始切断部分输入文件(在本例中为配置文件)是一个很好的做法。这样您就可以找到引入第一个错误的点,而且通常更容易以这种方式发现问题。

关于linux - conf 上的语法和 RNDC 绑定(bind)错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33394662/

相关文章:

linux - Azure 中推荐的副本集配置

wordpress - 如何在 Windows Azure 上安装多站点 WordPress

dns - 在 Amazon Route 53 上使用停放的 GoDaddy 域 - 导入区域文件失败

url - Example.com 替代方案

Linux下如何在没有IDE的情况下编写python文件

linux - 如何生成一个文件夹,其中包含最后添加的 X 个文件?

linux - 将 & 翻译成 %20%26%20

linux - Ubuntu 14.04 上的 fstab 问题

postgresql 无法创建用户/角色

android - zipalign : error while loading shared libraries: libc++. 所以:无法打开共享对象文件:没有这样的文件或目录