搭建DNS服务器实现域名解析 下载本文

//

// named.conf //

// Provided by Red Hat bind 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.

// 在/usr/share/doc/bind*/sample/ 文件夹中可查卡named配置案例 options {

listen-on port 53 { any; }; #监听地址,和端口 IPV4

listen-on-v6 port 53 { any; }; #监听地址,和端口 IPV6

directory \#工作目录

dump-file \\#数据存放目录

statistics-file \ats.txt\数据存放目录

memstatistics-file \mem_stats.txt\数据存放目录

allow-query { any; }; #允许解析的IP地址 recursion yes; # 开启递归查询 dnssec-enable yes; #开启加密

dnssec-validation yes; #在递归查询服务器上开启DNSSEC验证

/* Path to ISC DLV key */

bindkeys-file \#isc dlv key 的地址

managed-keys-directory \mic\#key的保存目录 };

logging { #日志

channel default_debug {

file \ severity dynamic; }; };

zone \IN { type hint;

file \ };

include \ include \

----------------- END ------------------- 实验手册: 实验环境:

Server: xiaogan64 ( CentOS6.8 ) IP: 192.168.31.64 ( eth0 )

Client: xiaogan63 ( CentOS6.8 ) IP: 192.168.31.63 ( eth0 ) Client端:

配置网卡选择vmnet6模式,ip地址 192.168.64.63

网关 192.168.64.1(server eth1 IPAddr) Server端:

配置eth0 选择桥接模式,IP 192.168.31.64 配置eth1 选择vmnet6模式,IP 192.168.64.1 安装DNS服务

yum -y install bind bind-chroot bind-utils

启动bind服务

/etc/init.d/named start service named start 挂载文件系统 mount