- 论坛徽章:
- 0
|
本主机名文件:
/etc/sysconfig/network
NETWORKING=yes
HOSTNAME=root.itfuture.org
/etc/named.conf配置文件如下:
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named( DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { any; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
#allow-query { localhost; };
allow-query { any; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
#view localhost_resolver {
# match-clients { localhost; };
# match-destinations { localhost; };
# recursion yes;
# include "/etc/named.rfc1912.zones";
#};
// named.rfc1912.zones:
//
// Provided by Red Hat caching-nameserver package
//
// ISC BIND named zone configuration for zones recommended by
// RFC 1912 section 4.1 : localhost TLDs and address zones
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
zone "." IN {
type hint;
file "named.ca";
};
zone "localdomain" IN {
type master;
file "localdomain.zone";
allow-update { none; };
};
zone "localhost" IN {
type master;
file "localhost.zone";
allow-update { none; };
};
zone "itfuture.org" IN {
type master;
file "itfuture.org.zone";
allow-update { none; };
};
zone "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "1.168.192.in-addr.arpa.zone";
allow-update { none; };
};
zone "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN{type master;
file "named.ip6.local";
allow-update { none; };
};
zone "255.in-addr.arpa" IN {
type master;
file "named.broadcast";
allow-update { none; };
};
zone "0.in-addr.arpa" IN {
type master;
file "named.zero";
allow-update { none; };
};
正向解析文件/var/named/chroot/var/named/itfuture.org.zone如下:
$TTL 86400
@ IN SOA @ root.itfuture.org. (
5;serial
28800;refresh
7200;retry
604800;expire
86400)
@ IN NS www.itfuture.org
@ IN A 192.168.1.1
www.itfuture.org IN A 192.168.1.1
反向解析文件/var/named/chroot/var/named/1.168.192.in-addr.arpa.zone如下:
$TTL 86400
@ IN SOA @ root.itfuture.org.(
2008021601;Serial
28800; Refresh
14400; Retry
3600000;Expire
86400)
@ IN NS www.itfuture.org.
1.1.168.192.in-addr-arpa. IN PTR itfuture.org.
1.1.168.192.in-addr-arpa. IN PTR www.itfuture.org.
启动dns服务器成功
[root@root ~]# service named start
[root@root ~]# 启动 named: [确定]
使用nslookup命令来测试dns服务器,报出错误也不能实现解析
[root@root ~]# nslookup
> www.itfuture.org
Server: 192.168.1.1
Address: 192.168.1.1#53
** server can't find www.itfuture.org.itfuture.org: SERVFAIL
> 192.168.1.1
Server: 192.168.1.1
Address: 192.168.1.1#53
** server can't find 1.1.168.192.in-addr.arpa: SERVFAIL
> |
|