- 论坛徽章:
- 0
|
最近,手头上的事情少下来,有空就多学学。呵呵,开始学一些服务器啦。这个月开始精学DNS,大家一起来交流。-------->>>大家觉得好,就推荐个吧,谢谢!
1、OS信息
[root@dns1 /]# more /etc/redhat-release
Red Hat Enterprise Linux AS release 4 (Nahant Update 4)
2、查看是否已经安装好了DNS软件(bind)
[root@dns1 /]# rpm -qa | grep bind
ypbind-1.17.2-8
bind-utils-9.2.4-16.EL4
bind-libs-9.2.4-16.EL4
3、经过查询,发现没有安装。插入cdrom,然后就开始安装啦,一般来说,是不会有问题的。
[root@dns1 /]# mount /media/cdrom/
mount: block device /dev/hdc is write-protected, mounting read-only
[root@dns1 /]# find /media/cdrom -name bind*
/media/cdrom/RedHat/RPMS/bind-9.2.4-16.EL4.i386.rpm
/media/cdrom/RedHat/RPMS/bind-chroot-9.2.4-16.EL4.i386.rpm
/media/cdrom/RedHat/RPMS/bind-devel-9.2.4-16.EL4.i386.rpm
/media/cdrom/RedHat/RPMS/bind-libs-9.2.4-16.EL4.i386.rpm
/media/cdrom/RedHat/RPMS/bind-utils-9.2.4-16.EL4.i386.rpm
[root@dns1 /]# rpm -ivh /media/cdrom/RedHat/RPMS/bind-9.2.4-16.EL4.i386.rpm
4、软件安装完成,配置/etc/named.conf文件
[root@dns1 /]# more /etc/named.conf
options {
pid-file "/var/run/named/named.pid";
directory "/var/named";
forwarders {
202.101.98.55;
};
allow-query { any; };
allow-transfer { any; };
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
};
logging {
channel query_log {
file "/var/named/log/query.log" versions 3 size 20m;
severity info;
print-time yes;
print-category yes;
};
category queries {
query_log;
};
};
zone "." {
type hint;
file "named.ca";
};
zone "localhost" {
type master;
file "named.localhost";
};
zone "0.0.127.in-addr.arpa" {
type master;
file "named.127.0.0";
};
5、配置localhost正向解析文件
[root@dns1 /]# more /var/named/named.localhost
$TTL 600
@ IN SOA localhost. root.localhost. (
2007120501
28800
14400
720000
86400 )
@ IN NS localhost.
localhost. IN A 127.0.0.1
6、配置localhost反向解析文件
[root@dns1 /]# more /var/named/named.127.0.0
$TTL 600
@ IN SOA localhost. root.localhost. (
2007120501
28800
14400
720000
86400 )
@ IN NS localhost.
1 IN PTR localhost.
7、OK,都配置好了,启动看看
[root@dns1 /]# service named start
Starting named: [ OK ]
8、查看日志,看看是否有错
[root@dns1 /]# tail -f /var/log/messages
Dec 5 14:56:11 dns1 named[3884]: listening on IPv4 interface lo, 127.0.0.1#53
Dec 5 14:56:11 dns1 named[3884]: listening on IPv4 interface eth0, 192.168.70.100#53
Dec 5 14:56:11 dns1 named[3884]: command channel listening on 127.0.0.1#953
Dec 5 14:56:11 dns1 named[3884]: command channel listening on ::1#953
Dec 5 14:56:11 dns1 named[3884]: zone 0.0.127.in-addr.arpa/IN: loaded serial 2007120501
Dec 5 14:56:11 dns1 named[3884]: zone localhost/IN: loaded serial 2007120501
Dec 5 14:56:11 dns1 named[3884]: running
Dec 5 14:56:12 dns1 named: named startup succeeded
呵呵,都成功。好啦,今天就到这儿,明天再继续。要是觉得好的话,就推荐一下吧,谢谢。
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/55457/showart_436465.html |
|