AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 837596
Accepted
Dimitrios Desyllas
Dimitrios Desyllas
Asked: 2017-03-11 15:33:45 +0800 CST2017-03-11 15:33:45 +0800 CST 2017-03-11 15:33:45 +0800 CST

尝试设置内部 dns

  • 772

在我工作的 Intranet 上,我们有不公开的内部应用程序,例如:app1.example.com、app2.example.com,而 example.com 是面向公众的网站。app1.example.com 和 app2.example.com 都解析为内网的 ip。

据我搜索,我发现这可以通过将本地 DNS 服务器连接到我们的 Intranet 来实现。

因此,我想通过使用 Virtualbox VM 来复制它,所以使用了 3 个 Ubuntu 风格的 Vm 的一个 Xubuntu、一个 Lubuntu 和一个 Ubuntu Budgie Edition 剩余的来自以前的“实验”。他们都有 2 个网络适配器:

  • 一种设置为 NAT 和
  • 另一个作为“内部网络”,静态具有来自192.0.0.0/24网络的 ips。

在 Xubuntu 上,我安装了 bind9 和一个网络服务器,并尝试通过输入 Xubuntu 和 Budgie Edition Vms 的浏览器 app1.intranet.example.com 和 app2.intranet.example.com 来模拟,以服务于 2 个不同的站点。这些站点在网络之外(这 3 个 Vms 的)将不可用,甚至无法解析这 2 个站点的 DNS 条目。

至于现在在运行绑定的虚拟机上(The Xubuntu One)有这些设置:

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


        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

         forwarders {
                208.67.222.222;
                208.67.220.220;
         };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        dnssec-validation auto;

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

acl "intranet" { 192.0.0.1/24; };
view "intranetView" {
        match-clients { "intranet"; };
        recursion yes;
        zone "intranet.example.com" {
                type master;
                file "/etc/bind/db.intranet"
        }
}

view "outside" {
        match-clients { any; }
        recursion no;
}

另外,/etc/bind/db.intranet我有以下条目:

;
; BIND data file for local loopback interface
;
$TTL    604800
@   IN  SOA intranet.example.com. root.example.com. (
                  2     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@   IN  NS  192.0.0.2
@   IN  A   192.0.0.2
app1    IN  A   192.0.0.2
app2    IN  A   192.0.0.2

但是由于某种原因,当我尝试重新启动绑定时它失败了。你能帮我找出问题所在吗?

ubuntu virtualbox bind split-dns
  • 2 2 个回答
  • 114 Views

2 个回答

  • Voted
  1. Best Answer
    Jacob Evans
    2017-03-11T15:39:57+08:002017-03-11T15:39:57+08:00

    NS 记录必须是主机名

    你也错过了一些;之后}

    命令:

    named-checkconf /etc/named.conf
    named-checkzone example.com example.com
    

    输出:

    example.com:12: NS record '192.0.0.2' appears to be an address
    zone example.com/IN: NS '192.0.0.2.example.com' has no address records (A or AAAA)
    zone example.com/IN: not loaded due to errors.
    
    • 1
  2. Ian Chilvers
    2017-03-11T16:55:10+08:002017-03-11T16:55:10+08:00

    除了雅各布的回复,您还错过了对 ip4 的监听。

    还要检查系统日志以获取任何有用的线索

    并尝试命名-checkconf 和命名-checkzone。在启动绑定服务之前非常有用的工具。

    • 0

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve