Howto DNS on FC6
a, Start the daemon==> service named restart
b, check the log ==> grep named /var/log/messages
loading configuration from '/etc/named.caching-nameserver.conf'
Jan 29 14:52:57 localhost named[1042]: listening on IPv6 interface lo, ::1#53
Jan 29 14:52:57 localhost named[1042]: listening on IPv4 interface lo, 127.0.0.1#53
Jan 29 14:52:57 localhost named[1042]: command channel listening on 127.0.0.1#953
Jan 29 14:52:57 localhost named[1042]: command channel listening on ::1#953
Jan 29 14:52:57 localhost named[1042]: zone 0.in-addr.arpa/IN: loaded serial 42
Jan 29 14:52:57 localhost named[1042]: zone 0.0.127.in-addr.arpa/IN: loaded serial 1997022700
Jan 29 14:52:57 localhost named[1042]: zone 255.in-addr.arpa/IN: loaded serial 42
Jan 29 14:52:57 localhost named[1042]: 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: loaded
serial 1997022700
Jan 29 14:52:57 localhost named[1042]: zone example.com/IN: loaded serial 2004121302
Jan 29 14:52:57 localhost named[1042]: zone qa-test.com/IN: loaded serial 2004121302
Jan 29 14:52:57 localhost named[1042]: zone localdomain/IN: loaded serial 42
Jan 29 14:52:57 localhost named[1042]: zone localhost/IN: loaded serial 42
Jan 29 14:52:57 localhost named[1042]: running
c, so the config is /etc/named.caching-nameserver.conf
d, add the zone you need to resolve in the above config
zone "example.com" {
type master;
file "pri.example.com";
};
zone "qa-test.com" {
type master;
file "qa-test.com";
};
zone "9.18.172.in-addr.arpa" IN {
type master;
file "172.18.9";
};
include "/etc/rndc.key";
==================================
e, add the file under the folder /var/named/chroot/var/named==> qa-test.com;pri.example.com
[root@localhost named]# more qa-test.com
$TTL 86400
@ IN SOA ns1.qa-test.com. hostmaster.qa-test.com. (
2004121302 ; serial, todays date + todays serial #
28800 ; refresh, seconds
7200 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
;
NS ns1.qa-test.com. ; Inet Address of name server 1
NS ns2.qa-test.com. ; Inet Address of name server 2
;
MX 10 mail.qa-test.com.
qa-test.com. A 172.18.9.28
bigsrv A 172.18.9.154
fc4 A 172.18.9.24
root@localhost named]# pwd
/var/named/chroot/var/named
[root@localhost named]# more 172.18.9
$TTL 86400
@ IN SOA fc4.qa-test.com. root.fc4.qa-test.com (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS fc4.qa-test.com
154 IN PTR bigsrv.qa-test.com
24 IN PTR fc4.qa-test.com
[root@localhost named]#
==================
f, the meaning of domain in the resolve.conf
without it:
[root@localhost ~]# nslookup bigsrv
Server: 127.0.0.1
Address: 127.0.0.1#53
** server can't find bigsrv: NXDOMAIN
[root@localhost ~]#
Add it:
domain qa-test.com
nameserver 127.0.0.1
[root@localhost ~]# nslookup bigsrv
Server: 127.0.0.1
Address: 127.0.0.1#53
Name: bigsrv.qa-test.com
Address: 172.18.9.154
===================================
No comments:
Post a Comment