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 / 问题 / 437338
Accepted
Nyxynyx
Nyxynyx
Asked: 2012-10-12 06:52:24 +0800 CST2012-10-12 06:52:24 +0800 CST 2012-10-12 06:52:24 +0800 CST

BIND 和 Virtualmin 的 DNS 问题(噩梦!)

  • 772

我有一个使用 Virtualmin/Webmin 的网络服务器(带有 LAMP 的 Ubuntu 12.04)。因为我刚从 Cpanel 系统迁移过来,所以我在配置 DNS 时遇到了噩梦!

使用 intoDNS.com,失败的报告是:

Mismatched NS records   WARNING: One or more of your nameservers did not return any of your NS records.
DNS servers responded   ERROR: One or more of your nameservers did not respond: The ones that did not respond are: 123.123.123.123 213.251.188.141x
Multiple Nameservers    ERROR: Looks like you have less than 2 nameservers. According to RFC2182 section 5 you must have at least 3 nameservers, and no more than 7. Having 2 nameservers is also ok by me.
Missing nameservers 
  reported by your nameserver   You should already know that your NS records at your nameservers are missing, so here it is again: 
                                    ns1.mydomain.com. sdns2.ovh.net. 
SOA record  No valid SOA record came back!
MX Records
WWW A Record     ERROR: I could not get any A records for www.mydomain.com!

我的逐步尝试

在我的域名注册商 (Namecheap) 中,我注册ns1.mydomain.com为域名服务器,指向我正在运行的网络服务器的 IP 地址bind9。该域使用 DNSns1.mydomain.com和sdns2.ovh.net. sdns2.ovh.net是辅助 DNS 服务器(SLAVE 并指向mydomain.com我的 Web 服务器的 IP 地址)

网络服务器域:mydomain.com

网络服务器主机名:ns4000000.ip-123-123-123.net

网络服务器 IP :123.123.123.123

在 Virtualmin 下,我编辑了默认的虚拟服务器模板,

  • 绑定新域的 DNS 记录:ns1.mydomain.com
  • 主 DNS 服务器主机名:ns1.mydomain.com

接下来,我使用该服务器模板创建了一个虚拟服务器。

这就是我所做的,但它仍然无法正常工作!有任何想法吗?我被困了好几天了,谢谢大家的帮助!

服务绑定9状态

* bind9 is running

lsof -i :53

COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
named   6966 bind   20u  IPv6 338583      0t0  TCP *:domain (LISTEN)
named   6966 bind   21u  IPv4 338588      0t0  TCP localhost.localdomain:domain (LISTEN)
named   6966 bind   22u  IPv4 338590      0t0  TCP ns4000000.ip-123-123-123.net:domain (LISTEN)
named   6966 bind  512u  IPv6 338582      0t0  UDP *:domain
named   6966 bind  513u  IPv4 338587      0t0  UDP localhost.localdomain:domain
named   6966 bind  514u  IPv4 338589      0t0  UDP ns4000000.ip-123-123-123.net:domain

/etc/resolv.con

(不知道怎么213.186.33.99来的)

nameserver 127.0.0.1
nameserver 213.186.33.99
search ovh.net

主机 123.123.123.123 (我的网络服务器的 IP)

13.60.245.198.in-addr.arpa domain name pointer ns4000000.ip-123-123-123.net.

nslookup 213.186.33.99

Server:         127.0.0.1
Address:        127.0.0.1#53

Non-authoritative answer:
99.33.186.213.in-addr.arpa      name = cdns.ovh.net.

Authoritative answers can be found from:
33.186.213.in-addr.arpa nameserver = ns.ovh.net.
33.186.213.in-addr.arpa nameserver = dns.ovh.net.

nslookup ns1.mydomain.com

;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; no servers could be reached

nslookup ns2.mydomain.com

;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; no servers could be reached

nslookup www.mydomain.com

;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; no servers could be reached

挖 mydomain.com

; <<>> DiG 9.8.1-P1 <<>> mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 43540
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mydomain.com.                  IN      A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Oct 11 11:30:09 2012
;; MSG SIZE  rcvd: 30

挖 ns1.mydomain.com

; <<>> DiG 9.8.1-P1 <<>> ns1.mydomain.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 31254
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;ns1.mydomain.com.              IN      A

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Oct 11 11:30:16 2012
;; MSG SIZE  rcvd: 34

/etc/bind/named.conf

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

/etc/bind/named.conf.default-zones

zone "." {
    type hint;
    file "/etc/bind/db.root";
};

zone "localhost" {
    type master;
    file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
    type master;
    file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
    type master;
    file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
    type master;
    file "/etc/bind/db.255";
};

/etc/bind/named.conf.local

zone "mydomain.com" {
    type master;
    file "/var/lib/bind/mydomain.com.hosts";
    allow-transfer {
        127.0.0.1;
        localnets;
        };
    };

/etc/bind/named.conf.options

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

    dnssec-validation auto;

    auth-nxdomain no;    # conform to RFC1035
    listen-on-v6 { any; };
//  allow-recursion { 127.0.0.1; };
//  transfer-source;
};

命名-checkconf -z

zone mydomain.com/IN: loaded serial 1349965194
zone localhost/IN: loaded serial 2
zone 127.in-addr.arpa/IN: loaded serial 1
zone 0.in-addr.arpa/IN: loaded serial 1
zone 255.in-addr.arpa/IN: loaded serial 1

iptables -L

Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             anywhere             udp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:20000
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:webmin
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:https
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:http
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:imaps
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:imap2
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pop3s
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:pop3
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ftp-data
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ftp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:domain
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:submission
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:smtp
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:ssh
ACCEPT     all  --  anywhere             anywhere

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
linux
  • 2 2 个回答
  • 6010 Views

2 个回答

  • Voted
  1. Best Answer
    Michael Hampton
    2012-10-12T08:52:52+08:002012-10-12T08:52:52+08:00

    您的输出named-checkconf -z表明 中存在语法错误/var/lib/bind/mydomain.com.hosts,这是您实际没有发布的唯一文件。检查文件并修复其中的任何错误。

    • 6
  2. Krijn Swinnen
    2014-01-03T18:27:56+08:002014-01-03T18:27:56+08:00

    要调试服务器问题,请始终在服务重启后检查日志:

    >

    tail -f /var/日志/消息

    或者

    tail -f /var/日志/系统日志

    ctrl+C 中止

    或者只显示 syslog 的最后 20 条记录

    tail -n 20 /var/日志/系统日志

    • 1

相关问题

  • Linux 主机到主机迁移

  • 如何在 Linux 机器上找到有关硬件的详细信息?

  • 如何在 Linux 下监控每个进程的网络 I/O 使用情况?

  • 在 RHEL4 上修改 CUPS 中的现有打印机设置

  • 为本地网络中的名称解析添加自定义 dns 条目

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