本文主要:
- 实现对域
example.com内的各类主机的域名解析。 - 实现对
mail.example.com,www.example.com,ns.example.com,app1.example.com,app2.example.com,java.example.com等域名的正向解析(所有域名对应的IP 地址都指向192.168.0.101)。 - 同时提供对上述域名的反向域名解析功能。
主要步骤:
- 安装bind9软件包,还有dnsutils软件包(DNS测试工具)。
sudo apt-get install bind9
sudo apt-get install dnsutils
- 在主配置/etc/bind/named.conf.local文件中添加正向和反向zone声明。
sudo vi /etc/bind/named.conf.local

image.png
sudo cp /etc/bind/db.local /etc/bind/db.example.com
再编辑正向解析区域文件:
sudo vi /etc/bind/db.example.com

image.png
sudo cp /etc/bind/db.127 /etc/bind/192
再编辑正向解析区域文件:
vi /etc/bind/db.192

image.png
-
重启BIND9并了解BIND的启动情况
image.png - 确保客户端中
/etc/resolv.conf文件中有域名服务器地址
image.png - 使用
nslookup测试
image.png - 使用
dig测试
image.png - 使用
named-checkzone进行区域文件有效性检查和转换
image.png
image.png - 使用
ping测试:
image.png






