liunx 多区域dns服务搭建

多区域dns

主配置文件  ----区域更改  地址库文件更改

地址库文件------  域名  主机名称   ip地址

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

options {

directory "/var/named";

        };

zone "sina.com" IN {

type master;

file "s.txt";

};

zone "qq.com" IN {

        type master;

        file "q.txt";

};

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

[root@localhost named]# cp -p s.txt q.txt

[root@localhost named]# vim q.txt

$TTL 1D

@ IN SOA @ rname.invalid. (

0 ; serial

1D ; refresh

1H ; retry

1W ; expire

3H ) ; minimum

qq.com. NS nihao

nihao    A       192.168.4.6

hhh             A       3.3.3.3

xxx             A       4.4.4.4

[root@localhost named]# cd

[root@localhost ~]# systemctl restart named

客户端测试

[root@localhost ~]# nslookup hhh.qq.com

Server: 192.168.4.6

Address: 192.168.4.6#53

Name: hhh.qq.com

Address: 3.3.3.3

[root@localhost ~]# nslookup xxx.qq.com

Server: 192.168.4.6

Address: 192.168.4.6#53

Name: xxx.qq.com

Address: 4.4.4.4

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值