Debian10 配置域名解析服务器

1、域名解析服务器配置

1.设置dns服务器指向
root@debian:~# vim /etc/resolv.conf
nameserver 192.168.199.101

2.安装服务
root@debian:~# apt install bind9 bind9utils dnsutils -y

3.编辑区域文件
root@debian:~# vim /etc/bind/named.conf.default-zones
zone “skills.com” {
type master;
file “/etc/bind/db.z”;
};
zone “199.168.192.in-addr.arpa” {
type master;
file “/etc/bind/db.f”;
};

4.编辑区域解析文件
复制解析文件
root@debian:~# cp -p /etc/bind/db.local /etc/bind/db.z
root@debian:~# cp -p /etc/bind/db.0 /etc/bind/db.f

5.编辑正向解析文件
root@debian:~# vim /etc/bind/db.z
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
node1 IN A 192.168.199.101
node2 IN A 192.168.199.102
node3 IN A 192.168.199.103

6.编辑反向解析文件
root@debian:~# vim /etc/bind/db.f
;
; BIND reverse data file for broadcast zone
;
$TTL 604800
@ IN SOA localhost. root.localhost. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
101 IN PTR node1.skills.com.
102 IN PTR node2.skills.com.
103 IN PTR node3.skills.com.

7.重启服务
root@debian:~# systemctl restart bind9
root@debian:~# systemctl enable bind9

8.测试bind9服务
root@debian:~# nslookup

192.168.199.101
101.199.168.192.in-addr.arpa name = node1.skills.com.
192.168.199.102
102.199.168.192.in-addr.arpa name = node2.skills.com.
192.168.199.103
103.199.168.192.in-addr.arpa name = node3.skills.com.
node1.skills.com
Server: 192.168.199.101
Address: 192.168.199.101#53

Name: node1.skills.com
Address: 192.168.199.101

node2.skills.com
Server: 192.168.199.101
Address: 192.168.199.101#53

Name: node2.skills.com
Address: 192.168.199.102

node3.skills.com
Server: 192.168.199.101
Address: 192.168.199.101#53

Name: node3.skills.com
Address: 192.168.199.103

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值