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
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[bind](ubuntu)

Martin Hope
Hossein Safari
Asked: 2021-01-29 08:00:02 +0800 CST

我无法在 ubuntu 20.04 中安装“bind9-dnsutils”

  • 0

当我尝试安装sudo apt-get install bind9-dnsutils时,我收到以下错误:

The following packages have unmet dependencies:
 bind9-dnsutils : Depends: bind9-libs (= 1:9.16.1-0ubuntu2) but 1:9.16.1-0ubuntu2.4 is to be installed
E: Unable to correct problems, you have held broken packages.

所以,我必须安装bind9-libs,当我尝试安装时sudo apt-get install bind9-libs ,我得到以下输出

Reading package lists... Done
Building dependency tree       
Reading state information... Done
bind9-libs is already the newest version (1:9.16.1-0ubuntu2.4).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我需要bind9-dnsutils安装nslookup.

我如何解决它?

bind
  • 1 个回答
  • 1793 Views
Martin Hope
Alpcap
Asked: 2020-12-05 04:28:50 +0800 CST

服务器找不到:SERVFAIL & Bind9 DNS 服务器设置

  • 2

我正在尝试在 VPS 服务器上部署 Web 应用程序。该应用程序使用 Django 构建,目前正在尝试使用 Apache2 提供文件。我在使用 DNS 设置(bind9)时遇到问题。我使用的公司对此没有帮助。

你能帮我解决这个我处理了 3 天的问题吗?

操作系统:

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.7 LTS
Release:        16.04
Codename:       xenial

_

nslookup example.com

;; Got SERVFAIL reply from 8.8.8.8, trying next server
Server:         8.8.4.4
Address:        8.8.4.4#53

** server can't find example.com : SERVFAIL

_

nslookup example.com 185.106.209.113

Server:         185.106.209.113
Address:        185.106.209.113#53

Name:   
Address: 185.106.209.113

当我访问http://185.106.209.113/地址时,我可以看到 Apache2 默认页面。如果我输入http://example.com/会抛出DNS_PROBE_FINISHED_NXDOMAIN错误。

|-- [-rwxr-xr-x bind    ]  bind.keys
|-- [-rwxr-xr-x bind    ]  db.0
|-- [-rwxr-xr-x bind    ]  db.127
|-- [-rwxr-xr-x bind    ]  db.255
|-- [-rwxr-xr-x bind    ]  db.empty
|-- [-rwxr-xr-x bind    ]  db.local
|-- [-rwxr-xr-x bind    ]  db.root
|-- [-rwxr-xr-x bind    ]  named.conf
|-- [-rwxr-xr-x bind    ]  named.conf.default-zones
|-- [-rwxr-xr-x bind    ]  named.conf.local
|-- [-rwxr-xr-x bind    ]  named.conf.local.back
|-- [-rwxr-xr-x bind    ]  named.conf.options
|-- [-rwxr-xr-x bind    ]  rndc.key
|-- [drwxr-sr-x bind    ]  zones
|   |-- [-rwxr-xr-x bind    ]  db.185.106
|   `-- [-rwxr-xr-x bind    ]  db.example.com
`-- [-rwxr-xr-x bind    ]  zones.rfc1918

命名的.conf.options:

acl "trusted" {
        185.106.209.113;
};



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

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.

        forwarders {
                185.106.209.113;
        };

        dnssec-validation auto;

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

命名.conf.local:

//include "/etc/bind/zones.rfc1918";

zone "example.com" {
        type master;
        file "/etc/bind/zones/db.example.com";
        allow-transfer { 185.106.209.113; };
        also-notify { 185.106.209.113; };
};

zone "209.106.185.in-addr.arpa" {
        type master;
        file "/etc/bind/zones/db.185.106";
        allow-transfer { 185.106.209.113; };
        also-notify {185.106.209.113; };
};

db.example.com:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
; NS records
@       IN      NS      ns1.example.com.
@       IN      NS      ns2.example.com.
@       IN      A       185.106.209.113

; A records
ns1.example.com.    IN      A       185.106.209.113
ns2.example.com.    IN      A       185.106.209.113

db.185.106

;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns1.example.com. root.example.com. (
                              3         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
; name servers - NS records
        IN      NS      ns1.example.com.
        IN      NS      ns2.example.com.

; PTR Records
113.209 IN      PTR     ns1.example.com.    ; 185.106.209.113
113.209 IN      PTR     ns2.example.com.    ; 185.106.209.113

和防火墙状态:

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
Apache Full                ALLOW       Anywhere
8000                       ALLOW       Anywhere
53                         ALLOW       Anywhere
22 (v6)                    ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
Apache Full (v6)           ALLOW       Anywhere (v6)
8000 (v6)                  ALLOW       Anywhere (v6)
53 (v6)                    ALLOW       Anywhere (v6)
server dns 16.04 bind
  • 2 个回答
  • 16053 Views
Martin Hope
Nate
Asked: 2020-05-16 12:29:32 +0800 CST

Named.Service 未激活

  • 0

我该如何解决named.service is not active, cannot reload.?的输出/etc/init.d/named status是

● named.service - BIND Domain Name Server
     Loaded: loaded (/lib/systemd/system/named.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2020-05-15 16:24:00 UTC; 2h 42min ago
       Docs: man:named(8)
    Process: 55460 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
   Main PID: 55460 (code=exited, status=1/FAILURE)

May 15 16:24:00 sturtz named[55460]: listening on IPv4 interface lo, 127.0.0.1#53
May 15 16:24:00 sturtz named[55460]: creating TCP socket: address in use
May 15 16:24:00 sturtz named[55460]: listening on IPv4 interface enp0s25, 192.168.0.5#53
May 15 16:24:00 sturtz named[55460]: creating TCP socket: address in use
May 15 16:24:00 sturtz named[55460]: unable to listen on any configured interfaces
May 15 16:24:00 sturtz named[55460]: loading configuration: failure
May 15 16:24:00 sturtz named[55460]: exiting (due to fatal error)
May 15 16:24:00 sturtz systemd[1]: named.service: Main process exited, code=exited, status=1/FAILURE
May 15 16:24:00 sturtz systemd[1]: named.service: Failed with result 'exit-code'.
May 15 19:02:52 sturtz systemd[1]: named.service: Unit cannot be reloaded because it is inactive.

我无法弄清楚错误或如何解决它。我正在运行 Ubuntu Server 20.04 LTS,我昨天安装了它,我在这里询问了 Bind9 设置 当我运行时sudo ss -tulpn | grep :53:

sudo: unable to resolve host sturtz: Name or service not known
udp     UNCONN   0        0                                 192.168.0.5:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=30))                                              
udp     UNCONN   0        0                                 192.168.0.5:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=31))                                              
udp     UNCONN   0        0                                   127.0.0.1:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=24))                                              
udp     UNCONN   0        0                                   127.0.0.1:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=25))                                              
udp     UNCONN   0        0                               127.0.0.53%lo:53                                           0.0.0.0:*                                   users:(("systemd-resolve",pid=826,fd=12))                                      
udp     UNCONN   0        0                                     0.0.0.0:5353                                         0.0.0.0:*                                   users:(("mdns-publisher",pid=1229,fd=5))                                       
udp     UNCONN   0        0                                       [::1]:53                                              [::]:*                                   users:(("named",pid=34374,fd=36))                                              
udp     UNCONN   0        0                                       [::1]:53                                              [::]:*                                   users:(("named",pid=34374,fd=35))                                              
udp     UNCONN   0        0          [fe80::223:24ff:fe08:581f]%enp0s25:53                                              [::]:*                                   users:(("named",pid=34374,fd=40))                                              
udp     UNCONN   0        0          [fe80::223:24ff:fe08:581f]%enp0s25:53                                              [::]:*                                   users:(("named",pid=34374,fd=41))                                              
udp     UNCONN   0        0                                        [::]:5353                                            [::]:*                                   users:(("mdns-publisher",pid=1229,fd=6))                                       
tcp     LISTEN   0        10                                192.168.0.5:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=34),("named",pid=34374,fd=33),("named",pid=34374,fd=32))
tcp     LISTEN   0        10                                  127.0.0.1:53                                           0.0.0.0:*                                   users:(("named",pid=34374,fd=29),("named",pid=34374,fd=28),("named",pid=34374,fd=27))
tcp     LISTEN   0        4096                            127.0.0.53%lo:53                                           0.0.0.0:*                                   users:(("systemd-resolve",pid=826,fd=13))                                      
tcp     LISTEN   0        10         [fe80::223:24ff:fe08:581f]%enp0s25:53                                              [::]:*                                   users:(("named",pid=34374,fd=44),("named",pid=34374,fd=43),("named",pid=34374,fd=42))
tcp     LISTEN   0        10                                      [::1]:53                                              [::]:*                                   users:(("named",pid=34374,fd=39),("named",pid=34374,fd=38),("named",pid=34374,fd=37))

在此处输入图像描述

server services bind 20.04
  • 1 个回答
  • 2437 Views
Martin Hope
Mohammed nzer
Asked: 2019-09-23 00:12:08 +0800 CST

托管 DNS 服务器(例如 bind9)

  • 0

您好,我是网络初学者。我有一些问题,希望你能回答我或给点指点,这样我就可以学习如何做到这一点:

我的服务器在家里有一个真正的静态 IP。在 Ubuntu 18.04 LTS 服务器上使用bind9,我/etc/bind/named.conf.options这样配置:

{
        listen-on-v6 { any; };
        allow-query  {any;  };
        recursion yes;
}

然后我为我的域配置创建了一个 db 文件:

$TTL 1d
$ORIGIN csgosyria.net.

@       IN      SOA     ns1     root    (
                20180904        ;Serial
                12h             ;Refresh
                15m             ;Retry
                3w              ;Expire
                2h              ;Minimum
        )

@       IN      A       my static ip

@       IN      NS      ns1
ns1     IN      A       my static ip


www     IN      A       my static ip

然后我将这些行添加到(named.conf.options):

zone "csgosyria.net" IN {
        type master;
        file "/var/cache/bind/db.csgosyria.net";
};

现在它看起来对我来说很好。我保存了所有文件并重新启动了bind9。它的作品没有任何错误;但问题是:当我csgosyria.net在浏览器中输入时,它说找不到服务器 IP 地址。

在运行 Windows 10 的客户端 PC 上,我将 DNS 从控制面板更改为静态 IP。然后,我重新输入我的域,它工作正常。

我该如何解决这个问题?我想在不将我的 IP 放入客户端 PC 的情况下使我的域正常工作(就像我输入 apnic.net 一样)。

我应该在某个地方注册我的 DNS 吗?

我应该使用一些端口或协议吗?

我应该在我的 Ubuntu 服务器上安装任何服务吗?

networking server dns bind
  • 1 个回答
  • 222 Views
Martin Hope
Bar
Asked: 2019-07-17 06:04:29 +0800 CST

CURL 不起作用,但 ping 和 nslookup 可以与本地 DNS 服务器 Ubuntu16.04 一起使用

  • 2

我们正在 Ubuntu 16.04 上使用 Bind 服务器。
我们无法curl,因为 DNS 解析但ping和nslookup正在从 Ubuntu16.04 客户端运行。

客户 - ping:

root@app-01:~# ping -c1 nightly.dev.project
PING nightly.dev.project (10.110.2.1) 56(84) bytes of data.
64 bytes from 10.110.2.1: icmp_seq=1 ttl=64 time=1.03 ms

--- nightly.dev.project ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.036/1.036/1.036/0.000 ms

客户 - nslookup:

root@app-01:~# nslookup nightly.dev.project
Server:     10.110.1.3
Address:    10.110.1.3#53

Name:   nightly.dev.project
Address: 10.110.2.1

客户 - curl:

root@app-01:~# curl -kv nightly.dev.project
* Rebuilt URL to: nightly.dev.project/
*   Trying 10.10.10.24...
* Connected to proxy.dev.com (10.10.10.24) port 8080 (#0)
> GET http://nightly.dev.project/ HTTP/1.1
> Host: nightly.dev.project
> User-Agent: curl/7.47.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 404 Not Found
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: Keep-Alive
< Connection: Keep-Alive
< Content-Length: 1082
<
<HTML><HEAD>

<TITLE>Network Error</TITLE>

</HEAD>

<BODY>

<FONT face="Helvetica">

<big><strong></strong></big><BR>

</FONT>

<blockquote>

<TABLE border=0 cellPadding=1 width="80%">

<TR><TD>

<FONT face="Helvetica">

<big>Network Error (dns_unresolved_hostname)</big>

<BR>

客户 - /etc/resolvconf/resolv.conf.d/head:

nameserver 10.110.1.3
nameserver 10.110.1.2
search dev.project

客户 - /etc/nsswitch:

#hosts:          files mdns4_minimal [NOTFOUND=return] dns
hosts:          dns files
networks:       files

绑定服务器 - /etc/bind/named.conf.options:

options {
    #dnssec-validation auto;
    dnssec-validation no;
    dnssec-enable no;
    allow-recursion { any; };
    allow-recursion-on { any; };
    allow-query { any; };

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
};
dns url bind curl
  • 1 个回答
  • 3946 Views
Martin Hope
Fizer450
Asked: 2019-07-11 03:02:37 +0800 CST

如何在不输入 FQDN 的情况下访问我的网站,只需输入域

  • 2

要访问我的网站(现在只是一个测试页面),我必须输入 hostname.domainname.com。我想而不是只输入域名(domain.com)。

我是否必须配置 BIND,是否需要其他应用程序或是否需要更改域注册 (CloudFlare)。

目前在 Ubuntu Server 18.04 全面更新!

对不起,我的英语不好!谢谢!

networking server dns bind
  • 1 个回答
  • 304 Views
Martin Hope
Adham Sabry
Asked: 2019-06-27 17:27:57 +0800 CST

maas-dhcpd 未开启,因为 bind9 127.0.0.1#954: connection denied

  • 0

有谁知道如何解决这个问题?

Service 'maas-dhcpd' is not on, it will be started.
Service 'bind9' failed to start. Its current state is 'dead' and 'Result: exit-code'.
Reloading BIND failed (is it running?): Command `rndc -c /etc/bind/maas/rndc.conf.maas reload` returned non-zero exit status 1:#012rndc: connect failed: 127.0.0.1#954: connection refused

我有 2 个子网、一个网桥和一个本地网络,有 3 个接口 eth0、eth1、br1 我的网络接口:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
dns-nameservers x.x.1.1
dns-search maas

# The primary network interface
auto eth0
iface eth0 inet static
address x.x.1.2
netmask 255.255.255.0
gateway x.x.1.1
dns-nameservers x.x.1.1 8.8.8.8 8.8.4.4
mtu 1500

auto eth1
iface eth1 inet manual
mtu 1500

auto br1
iface br1 inet static
address x.x.30.1
netmask 255.255.255.0
   bridge_ports eth1
   bridge_stp off
   bridge_fd 0
   bridge_maxwait 0

UI 中的 Maas 子网配置:以下情况禁用托管分配:

Name x.x.1.0/24
CIDR x.x.1.0/24
Gateway IP x.x.1.2
DNS 172.16.1.1

为以下启用托管分配:

Name x.x.30.0/24
CIDR x.x.30.0/24
Gateway IP x.x.30.1
DNS x.x.1.1

运行sudo rndc -c /etc/bind/maas/rndc.conf.maas reload结束于:

rndc: connect failed: 127.0.0.1#954: connection refused

我不确定我错过了什么,这个 MaaS 版本是 2.5

附加说明:在我调查时,我注意到 中有重复的条目named.conf.maas,如果我手动修复重复项,它将再次自动生成并返回相同的问题。

/etc/bind/maas/named.conf.maas:92: zone 'x.y.z.in-addr.arpa': already exists previous definition: /etc/bind/maas/named.conf.maas:56

上述问题与https://discourse.maas.io/t/face-old-bug-lp-1683047-with-maas-2-5-stable-bind9-fails-to-start-duplicated-entry/有关314

networking server dhcp maas bind
  • 1 个回答
  • 286 Views
Martin Hope
Stephen Boston
Asked: 2019-01-16 16:12:13 +0800 CST

传输时的 bind9 从属错误:转储主文件:/etc/bind/zones... 打开:权限被拒绝

  • 0
BIND 9.11.4-3 Ubuntu 18.10 

该错误出现在以下日志之后,这似乎表明成功,尽管有一个我不明白的 apparmor 错误

行的顺序是最新的在顶部:

 ....
Jan 15 16:00:21 vaio named[25553]: transfer of '0.0.10.in- 
addr.arpa/IN' from 10.0.0.110#53: Transfer status: success
....

 Jan 15 16:00:20 vaio audit[25553]: AVC apparmor="DENIED" 
 operation="mknod" profile="/usr/sbin/named" 
  name="/etc/bind/zones/tmp-wTjV9cpi5S" pid=25553 comm="isc- 
  worker0000" requested_mask="c" denied_mask="c" fsuid=126 ouid=126

 Jan 15 16:00:20 vaio named[25553]: dumping master file: 
 /etc/bind/zones/tmp-wTjV9cpi5S: open: permission denied

区域文件位于/etc/bind/zones,该目录的权限为:

drwxrwsr-x   2 bind bind  4096 2019-01-15 15:20 zones
dns bind
  • 2 个回答
  • 8935 Views
Martin Hope
user610658
Asked: 2018-11-22 19:11:01 +0800 CST

如何解析域名

  • 0

我最初将此发布到 stack-overflow 是因为我认为他们可以给我一些见解,但是我只是被否决了,他们不明白我在标题中所说的内容。我正在尝试让 bind9 将我的域名解析为 IPv4 地址,但是 bind9 没有检测到我设置的名为/etc/bind/db.Domain.zone的解析文件,甚至没有检测到默认的本地文件 db.local

我真的很困惑如何解决这个问题,大约一个月前我向 bind9 支持发送了一个寻求帮助的请求,但我从未收到任何回复。所有者将我送到社区论坛,但我从未被接受。我已经安装了bind9 bind9utils bind9-doc bind9-host并且我还设置了我的主机文件如下,所以 O 也可以将我的主机名链接到它

echo -e "192.168.1.101  cheese.com  chewy" >> /etc/hosts

hostnamectl set-hostname chewy

然后我能够运行ping -c cheese.com并在启用 ICMP 请求后在同一主机上收到响应,但我无法从网络中或网络外部的另一台计算机上 ping Evil.com,我的接下来是为我的偏好配置named.conf.options文件

acl TrustedPPL { 192.168.1.0/24; 192.168.1.101; };

acl NoAccess { 192.168.1.111; };

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

           allow-query { TrustedPPL; };
           blackhole { NoAccess; };

           recursion yes;

           allow-recursion { localnets; 192.168.1.0/24; };
           listen-on port 53 { 192.168.1.101; 127.0.0.1; };
           forwarders { 192.168.1.1; 8.8.8.8; 8.8.4.4; };

           dnssec-validation auto;
           dnssec-lookaside auto;
           dnssec-enable yes;
           auth-nxdomain no; 

           tcp-listen-queue 25;
           transfers-in 25;
           transfers-out 25;
           tcp-clients 200;
           };

此时我已经重新启动了 bind9,所以我会收到任何错误的通知,没有错误,所以我继续制作区域名称和区域文件,我还将包括区域文件的内容

echo -e 'zone "cheese.com" IN { type master; file "/etc/bind/db.Domain.zone"; };' > /etc/bind/named.conf.local


区域文件/etc/bind/db.Domain.zone

 $TTL 3h

@  IN   SOA  cheese.com. root. (
                                            15   ; Serial
                                            3h   ; Refresh
                                            1h   ; Retry
                                            1w   ; Expire
                                            1h ) ; Negative Cache TTL

@   IN    NS  cheese.com.
@   IN    A   192.168.1.101

然后我使用了dig cheese.com,我得到一个回复​​,显示 IPv4 是 192.168.1.101,然后我用nslookup确认它,它也准确无误。

所以我决定测试它的分辨率部分并将@ IN A 192.168.1.101 更改为 192.168.1.111然后更改序列号并重新启动 bind9 没有错误,我做了一个dig cheese.com并返回 192.168.1.101再次。所以此时我很好奇文件 db.Domain.zone 是否被检测到,所以我将文件 db.Domain.zone 与 db.local 一起完全删除,好吧 dig 和 nslookup 显示 bind9 甚至没有检测到它是自己的分辨率文件,因为它仍然返回 192.168.1.101 和 127.0.0.1 任何想法?


这是我的/etc/nsswitch.conf文件

passwd:         compat systemd
group:          compat systemd
shadow:         compat
gshadow:        files

hosts:          dns 
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

我也尝试过使用原始/etc/bind/named.conf.options文件进行此尝试,但没有任何变化。

也没有 dnsmasq 或 nscd 缓存守护进程

默认的localhost文件/etc/bind/db.local也从127.0.0.1改成了127.0.1.1之前删了看看是不是我的配置,dig还是返回了127.0.0.1,谁能确认这是一个bind9 问题,或者如果这是我的设置问题

dns bind
  • 1 个回答
  • 535 Views
Martin Hope
DrSeussFreak
Asked: 2018-05-22 09:17:16 +0800 CST

绑定转发区不工作

  • 3

运行 Ubuntu 18.04 LTS,我正在尝试将 Bind 配置为我的家庭实验室的 DNS 服务器,因为某些软件 (VMware) 需要运行 DNS。

我有反向查找处理问题,但正向查找返回 0 个答案。nslookup 也找不到域,如果我更改此服务器以在“/etc/resolv.conf”中将其自身用于 DNS,则它没有网络连接。

我的绑定配置的内容是

命名.conf

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";

命名.conf.options

acl "trusted" {
        10.0.1.90;
        10.0.1.55;
        10.0.1.57;
        10.0.1.58;
        10.0.1.100;
};

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

        recursion yes;                 # enables resursive queries
        allow-recursion { trusted; };  # allows recursive queries from "trusted" clients
        listen-on { 10.0.1.90; };   # ns1 private IP address - listen on private network only
        allow-transfer { none; };      # disable zone transfers by default

        forwarders {
                10.0.1.1;
                8.8.8.8;
                8.8.8.4;
        };

        dnssec-validation no;

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

命名.conf.local

zone "myhome.lan" {
        type master;
        file "/etc/bind/for.myhome.lan";
};

zone "1.0.10.in-addr.arpa" {
        type master;
        file "/etc/bind/rev.myhome.lan";
};

for.myhome.lan

$TTL 86400
@   IN  SOA    dns-01.myhome.lan. admin.myhome.lan. (
        2018052102  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)

; Name Servers - NS records
@        IN      NS      dns-01.myhome.lan.

; Name Servers - A Records
dns-01  IN      A       10.0.1.90

; VMware

vcsa-01 IN      A       10.0.1.100
esxi-01 IN      A       10.0.1.55
esxi-02 IN      A       10.0.1.57
esxi-03 IN      A       10.0.1.58

rev.myhome.lan

$TTL 86400
@   IN  SOA     myhome.lan. admin.myhome.lan. (
        2018052101  ;Serial
        3600        ;Refresh
        1800        ;Retry
        604800      ;Expire
        86400       ;Minimum TTL
)

; Name Servers - NS records
@       IN      NS      dns-01.myhome.lan.

; Name Servers - A Records
dns-01  IN      A       10.0.1.90

; PTR Records
90      IN      PTR     dns-01.myhome.lan.
100     IN      PTR     vcsa-01.myhome.lan.
55      IN      PTR     esxi-01.myhome.lan.
57      IN      PTR     esxi-02.myhome.lan.
58      IN      PTR     esxi-03.myhome.lan.

检查一切看起来都不错

root@dns-01:/etc/bind# named-checkconf
root@dns-01:/etc/bind# named-checkzone myhome.lan for.myhome.lan 
zone myhome.lan/IN: loaded serial 2018052102
OK
root@dns-01:/etc/bind# named-checkzone myhome.lan rev.myhome.lan    
zone myhome.lan/IN: loaded serial 2018052101
OK

但是 dig 和 nslookup 不起作用

root@dns-01:/etc/bind# dig -x 10.0.1.90

; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> -x 10.0.1.90
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10718
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;90.1.0.10.in-addr.arpa.                IN      PTR

;; ANSWER SECTION:
90.1.0.10.in-addr.arpa. 0       IN      PTR     dns-01.
90.1.0.10.in-addr.arpa. 0       IN      PTR     dns-01.local.

;; Query time: 14 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon May 21 17:14:41 UTC 2018
;; MSG SIZE  rcvd: 97

root@dns-01:/etc/bind# dig myhome.lan

; <<>> DiG 9.11.3-1ubuntu1-Ubuntu <<>> myhome.lan
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 51346
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;myhome.lan.                  IN      A

;; Query time: 1 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Mon May 21 17:14:48 UTC 2018
;; MSG SIZE  rcvd: 41

root@dns-01:/etc/bind# nslookup myhome.lan
Server:         127.0.0.53
Address:        127.0.0.53#53

** server can't find myhome.lan: NXDOMAIN

我正在用头撞墙,非常感谢您帮助识别问题!

networking server dns 18.04 bind
  • 1 个回答
  • 7919 Views

Sidebar

Stats

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

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve