I'm trying to set up a DNS server (to manage local domain and hosts) on RHEL4ES. Actually, I followed the instructions here:
http://www.samspublishing.com/librar...eqNum=129&rl=1
However, unlike the instruction, I use
icecastle.net as my local domain name instead of
domain.cxm, and use the server name
iceserver instead of
mainserv. Also, my local network IP is 192.168.21.x instead of 192.168.100.x.
(by the way, the iceserver's IP address is 192.168.21.239).
First, I created two files: named.icecastle.net and named.192.168.21, then stored it in the directory /var/named/.
Here's the content of
named.icecastle.net. iceheart-winxp is the host name of my notebook, by the way.
Code:
; should be stored as /var/named/named.icecastle.net
@ IN SOA iceserver.icecastle.net. hostmaster.icecastle.net. (
2007022201 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS iceserver
IN MX 10 iceserver
iceserver IN A 192.168.21.239
iceheart-winxp IN A 192.168.21.158
www IN CNAME iceserver
And here's the content of
named.192.168.21:
Code:
; should be stored as /var/named/named.192.168.21
@ IN SOA iceserver.icecastle.net. hostmaster.icecastle.net. (
2007022201 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS iceserver.icecastle.net.
1 IN PTR iceserver.icecastle.net.
2 IN PTR iceheart-winxp.icecastle.net.
And then I added the following lines to the file
/etc/named.conf:
Code:
zone "icecastle.net" IN { #DNS for all host this domain
type master; #file on this host
file "named.icecastle.net"; #dns file for domain
};
zone "21.168.192.in-addr.arpa" IN { #DNS for all IP's in subnet
type master; #file on this host
file "named.192.168.21"; #DNS file for this subnet
};
I then restarted the named service without problems:
Code:
[root@iceserver ~]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
When I tried to ping iceserver, it worked. When I tried to ping iceserver.icecastle.net, it worked as well:
Code:
[root@iceserver ~]# ping iceserver
PING iceserver.icecastle.net (192.168.21.239) 56(84) bytes of data.
64 bytes from iceserver.icecastle.net (192.168.21.239): icmp_seq=0 ttl=64 time=1.44 ms
Code:
[root@iceserver ~]# ping iceserver.icecastle.net
PING iceserver.icecastle.net (127.0.0.1) 56(84) bytes of data.
However, when I tried to ping
the domain icecastle.net, it just failed. And when I tried to ping
www.icecastle.net (www is the alias name for iceserver), it failed as well.
Also, when I tried to nslookup the iceserver, it failed as well, despite the ping was successful. Thus, I highly suspect that the ping was using the /etc/hosts file instead of the DNS.
Code:
[root@iceserver ~]# nslookup iceserver
Server: 192.168.21.239
Address: 192.168.21.239#53
** server can't find iceserver: NXDOMAIN
And when I tried to nslookup my local domain (icecastle.net), it failed as well:
Code:
[root@iceserver ~]# nslookup iceserver.icecastle.net
Server: 192.168.21.239
Address: 192.168.21.239#53
** server can't find iceserver.icecastle.net: SERVFAIL
So I guess the new zones I added to my DNS do not work at all. However, forwarding still works, since I can still nslookup for external domains like yahoo.com.
What actually happens? Help!
Here's the content of my /etc/resolv.conf file, by the way:
Code:
[root@iceserver ~]# cat /etc/resolv.conf
nameserver 192.168.21.239
And here's the full content of my /etc/named.conf
Code:
[root@iceserver ~]# cat /etc/named.conf
//
// named.conf for Red Hat caching-nameserver
//
options {
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
forwarders {
192.168.21.25;
202.47.78.8;
202.47.78.9;};
};
//
// a caching only nameserver config
//
controls {
inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
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 "0.0.127.in-addr.arpa" IN {
type master;
file "named.local";
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; };
};
zone "icecastle.net" IN { #DNS for all host this domain
type master; #file on this host
file "named.icecastle.net"; #dns file for domain
};
zone "21.168.192.in-addr.arpa" IN { #DNS for all IP's in subnet
type master; #file on this host
file "named.192.168.21"; #DNS file for this subnet
};
include "/etc/rndc.key";