奇怪的DNS问题,虚拟机下可以,真实的环境却出错,希望大家帮助下

博主在虚拟机中成功搭建DNS服务器后,尝试在真实环境中部署时遇到问题。尽管配置文件相同,但在真实环境中查询特定域名时返回了错误的IP地址。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://linux.chinaunix.net/bbs/thread-1094816-1-1.html

我按照上面的文章搭建DNS,当我在虚拟机下作的时候是正确的,可以显示的服务器和IP的,当我在真实环境下作的时候,显示的却是错误的,
[root@rhel5 named]# nslookup
> [url]www.world7th.net[/url]
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   [url]www.world7th.net[/url]
Address: 218.83.175.155
> [url]www.world7th.org[/url]
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   [url]www.world7th.org[/url]
Address: 218.83.175.155
> [url]www.world7th.cn[/url]
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   [url]www.world7th.cn[/url]
Address: 159.226.7.162
> mail.world7th.net
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   mail.world7th.net
Address: 218.83.175.155
> mail.world7th.org
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   mail.world7th.org
Address: 218.83.175.155
> mail.world7th.cn
Server:         124.74.213.68
Address:        124.74.213.68#53

Non-authoritative answer:
Name:   mail.world7th.cn
Address: 218.83.175.155
>
 我也是第一次弄DNS,不知道是啥原因,我把我的配置文件铁出来,大家给个建议吧,配置文件我和虚拟机下的都是按照上面的网址的文字搭建的,却欻现不一样的问题,实在有点郁闷,我把配置文件铁出来
gedit world7th.cn.zone

$TTL    86400
@        IN SOA    localhost root (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum
            IN NS        world7th.cn
                IN    MX 10    mail.world7th.cn
www            IN    A            192.168.1.185
mail            IN    A            192.168.1.186
localhost    IN A        127.0.0.1       


gedit world7th.net.zone
$TTL    86400
@        IN SOA    localhost root (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum
            IN NS        world7th.net
             IN MX 10    mail.world7th.net
www            IN    A            192.168.1.181
mail            IN    A            192.168.1.182
localhost    IN A        127.0.0.1

gedit world7th.org.zone
$TTL    86400
@        IN SOA    localhost root (
                    42        ; serial (d. adams)
                    3H        ; refresh
                    15M        ; retry
                    1W        ; expiry
                    1D )        ; minimum
            IN NS        world7th.org
            IN    MX    10        mail.world7th.org
www            IN    A            192.168.1.183
mail            IN    A            192.168.1.184
localhost    IN A        127.0.0.1       
  上面三个都是一个类型的

 gedit 1.168.192.in-addr.local
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
        IN      NS      world7th.net.
          IN      NS      world7th.org.
           IN      NS      world7th.cn.
181       IN      PTR     [url]www.world7th.net.[/url]
182        IN            PTR        mail.world7th.net.
183        IN            PTR        [url]www.world7th.org.[/url]
184        IN           PTR        mail.world7th.org
185        IN            PTR        [url]www.world7th.cn[/url]
186        IN            PTR        mail.world7th.cn

 gedit named.rfc1912.zones

gedit named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
    listen-on port 53 { any; };
    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    //query-source    port 53;   
    //query-source-v6 port 53;
    allow-query     { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
    match-clients        { any; };
    match-destinations { any; };
    recursion yes;
    include "/etc/named.rfc1912.zones";
};


 gedit named.rfc1912.zones

// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
    type hint;
    file "named.ca";
};

zone "localdomain" IN {
    type master;
    file "localdomain.zone";
    allow-update { none; };
};

zone "localhost" IN {
     type master;
     file "localhost.zone";
     allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
    type master;
    file "named.local";
    allow-update { none; };
};

zone "255.in-addr.arpa" IN {
     type master;
     file "named.broadcast";
     allow-update { none; };
};

zone "0.in-addr.arpa" IN {
     type master;
     file "named.zero";
     allow-update { none; };
};
zone "world7th.net" IN {
        type master;
    file "world7th.net.zone";
    allow-update { none; };
};

zone "world7th.org" IN {
        type master;
    file "world7th.org.zone";
    allow-update { none; };
};

zone "world7th.cn" IN {
        type master;
    file "world7th.cn.zone";
    allow-update { none; };
};


zone "1.168.192.in-addr.arpa" IN {
    type master;
    file "1.168.192.in-addr.local";
    allow-update { none; };
};


以上就是我所以的配置文件,我在虚拟机下可以成功的,在真实的环境下却不行,希望大虾给指点下,到底是那里出来问题,我是ADSL的用户,实验是可以上网,我的网卡的ip是192.168.1.123,希望帮帮我吧。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值