红帽Linux配置DNS服务器

1.         查看是否安装了相应的软件包#rpm –qa|grep bind

2.         需要安装的组件

(1)                                           bind-9.3.3-7.e15.i386.rpm

(2)                                           bind-chroot-9.3.3-7.e15.i386.rpm

(3)                                           catching-nameserver-9.3.3.7-e15.i386.rpm

(4)                                           bind-libs-9.3.3-7.e15.i386.rpm

(5)                                           bind-utils-9.3.3-7.e15.i386.rpm

(6)                                           bind-devel-9.3.3-7.e15.i386.rpm

(7)                               
           
system-config-bind-4.0.3-2.e15.noarch.rpm

3.         设置主机名和IP地址(静态)

#vi  /etc/sysconfig/network

#vi /etc/sysconfig/network-scripts/ifcfg-eth0

4.         编辑主配置文件

查找

#find  / -name named*

#cp(空格)  /usr/share/doc/bind-9.3.3/sample/etc/named.conf(空格)/var/named/chroot/etc/named.conf

编辑主配置文件

#vi /var/named/chroot/etc/named.conf

声明正向解析和反向解析的区域

5.         设置正向解析和反向解析的文件

#cd  /var/named/chroot/var/named

#cp  localhost.zone  abc.com.zone

#vi  abc.com.zone

编辑反向解析区域文件

#cp  named.local  192.168.1.arpa

#vi  192.168.1.arpa

#chown named.named   /var/named/chroot/var/named/*

#ln  -s  /var/named/chroot/var/named/*  /var/named

#ln  –s  /var/named/chroot/etc/named.conf  /etc/named.conf

6.         启动DNS服务器

#service  named  start

#/etc/init.d/named  start

如设置在多个运行级别下启动

#chkconfig –level 235 named on

7.         测试

#nslookup

#host

#dig

8.         LINUX客户端的配置

#vi  /etc/resolv.conf

文件内容

nameserver  192.168.1.1

 

 

阅读剩余
THE END