当前位置:   article > 正文

傻瓜式:局域网内部搭建DNS域名解析服务_局域网dns解析

局域网dns解析

首先安装所需的yum源

1、yum install -y bind

2、yum install -y bind-utils          

3、yum -y install vim

4、修改DNS主配置文件

[root@localhost /]# vim /etc/named.conf

5、修改这两行的内容

listen-on port 53 { any; };
allow-query     { any; };                    

6、给本机的DNS指向自己的dns服务(最后操作也可以)

[root@localhost /]# vim /etc/resolv.conf 

# Generated by NetworkManager

nameserver 192.168.*.*       //新增一个本地设备的IP地址信息

nameserver 114.114.114.114

修改配置文件:vim /etc/named.rfc1912.zones

zone "zzz.com" IN {

        type master;

        file "zhengxiang";

        allow-update { none; };

};

zone "localhost" IN {

        type master;

        file "named.localhost";

        allow-update { none; };

};

zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN {

        type master;

        file "named.loopback";

        allow-update { none; };

};

zone "2.168.192.in-addr.arpa" IN {

        type master;

        file "fanxiang";

        allow-update { none; };

};

8、进入DNS服务器配置下文件目录

[root@localhost /]#cd /var/named

[root@localhost named]# cp -p  named.localhost   zhengxiang

[root@localhost named]#cp -p named.loopback  fanxiang

9、编辑正向区域配置文件,

[root@localhost named]# vim   zhengxiang  

  

10、修改并添加以下行:

$TTL 1D

@       IN SOA  @ zzz.com. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        NS      dns.zzz.com.

www     A       192.168.2.14

dns     A       192.168.2.14

11、编辑反向区域配置文件,

[root@localhost named]# vim   fanxiang  

  

12、修改并添加以下行:

$TTL 1D

@       IN SOA  @ zzz.com. (

                                        0       ; serial

                                        1D      ; refresh

                                        1H      ; retry

                                        1W      ; expire

                                        3H )    ; minimum

        NS      dns.zzz.com.

14      PTR     www.zzz.com.

14      PTR     dns.zzz.com.

13、启动域名解析服务器

[root@localhost named]# systemctl start named

14、查看状态

systemctl status named.service

15、显示如下则表示成功 此为正向解析

[root@localhost named]# nslookup www.zzz.com

16、显示如下则表示成功 此为反向解析

[root@localhost named]# nslookup 192.168.2.14

17、所有步骤(简洁) 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/178761?site
推荐阅读
相关标签
  

闽ICP备14008679号