在 CentOs 5.8 上设置 DNS 服务器

在 CentOs 5.8 上设置 DNS 服务器

我在 VPS(CentOs 5.8 32 位)上设置 DNS 服务器时遇到了一些问题

我已经使用 ISPConfig 3 向导配置了 DNS 区域。我的名称服务器在我的域名注册商(雅虎)处注册

我将我的域名配置为使用我的名称服务器:

ns1.mydomain.com
ns2.mydomain.com

但是,当我进入我的域名时,它显示未找到页面。


真正的错误是“找不到 domainname.com”


named.conf (位于 /var/named/chroot/etc 中)

//
// Sample named.conf BIND DNS server 'named' configuration file
// for the Red Hat BIND distribution.
//
// See the BIND Administrator's Reference Manual (ARM) for details, in:
//   file:///usr/share/doc/bind-*/arm/Bv9ARM.html
// Also see the BIND Configuration GUI : /usr/bin/system-config-bind and
// its manual.
//
options
{
    // Those options should be used carefully because they disable port
    // randomization
    // query-source    port 53;
    // query-source-v6 port 53;

    // Put files that named is allowed to write in the data/ directory:
    directory "/var/named"; // the default
    dump-file               "data/cache_dump.db";
    statistics-file         "data/named_stats.txt";
    memstatistics-file      "data/named_mem_stats.txt";

};
logging
{
/*      If you want to enable debugging, eg. using the 'rndc trace' command,
 *      named will try to write the 'named.run' file in the $directory (/var/named).
 *      By default, SELinux policy does not allow named to modify the /var/named  directory,
 *      so put the default debug log file in data/ :
 */
     channel default_debug {
         file "data/named.run";
         severity dynamic;
     };
};
//
// All BIND 9 zones are in a "view", which allow different zones to be served
// to different types of client addresses, and for options to be set for groups
// of zones.
//
// By default, if named.conf contains no "view" clauses, all zones are in the
// "default" view, which matches all clients.
//
// If named.conf contains any "view" clause, then all zones MUST be in a view;
// so it is recommended to start off using views to avoid having to restructure
// your configuration files in the future.
//

答案1

您的服务器上的DNS服务器软件配置有问题。从以下DNS诊断问题可以看出这一点。

您的域名已正确委派 ( dig ns uk2be.com):

;; QUESTION SECTION:
;uk2be.com.         IN  NS

;; ANSWER SECTION:
uk2be.com.      172800  IN  NS  ns1.uk2be.com.
uk2be.com.      172800  IN  NS  ns2.uk2be.com.

尽管它是一台单台服务器,但粘合记录是存在的(dig ns1.uk2be.com和):dig ns2.uk2be.com

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

;; ANSWER SECTION:
ns1.uk2be.com.      172726  IN  A   46.37.174.74

------

;; QUESTION SECTION:
;ns2.uk2be.com.         IN  A

;; ANSWER SECTION:
ns2.uk2be.com.      172714  IN  A   46.37.174.74

但您的 DNS 服务器没有响应任何查询(dig soa uk2be.com @46.37.174.74dig www.uk2be.com @46.37.174.74):

; <<>> DiG 9.7.3 <<>> soa uk2be.com @46.37.174.74
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 24146
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;uk2be.com.         IN  SOA

;; Query time: 21 msec
;; SERVER: 46.37.174.74#53(46.37.174.74)
;; WHEN: Fri Aug 17 18:30:18 2012
;; MSG SIZE  rcvd: 27

------

; <<>> DiG 9.7.3 <<>> www.uk2be.com @46.37.174.74
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 21070
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.uk2be.com.         IN  A

;; Query time: 17 msec
;; SERVER: 46.37.174.74#53(46.37.174.74)
;; WHEN: Fri Aug 17 18:30:48 2012
;; MSG SIZE  rcvd: 31

假设您的服务器确实使用此 IP 地址 (46.37.174.74),则您的 DNS 软件配置有误。您使用的是哪种 DNS 软件?您在日志中看到任何错误吗?

为了测试目的,您可能需要尝试一些在线工具:

相关内容