Dynamic Name Server
1)install named
1@@@@named is belong to package "bind*"
#yum -y install bind* @@@install all packages.
2@@@@others
@@@Note:
@@@environment is RHEL6.2_x86_64
@@@kernel => 2.6.32-220........
2)Configure named
1@@@@/etc/named.conf
[root@station78 named]# cat /etc/named.conf
options {
directory "/var/named";
};
zone "." IN {
type hint;
file "named.ca";
};
zone "example.com" IN {
type master;
file "example.com.zone";
};
zone "0.168.192.in-addr.arpa" IN {
type master;
file "192.168.0.zone";
};
2@@@@/var/named
[root@station78 named]# cat example.com.zone
$TTL 1D
@ IN SOA station78.example.com. root.station78.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS station78.example.com.
example.com. IN A 192.168.0.78
station78.example.com. IN A 192.168.0.78
example.com. IN MX 2 station78.example.com.
@@@
[root@station78 named]# cat 192.168.0.zone
$TTL 1D
@ IN SOA station78.example.com. root.station78.example.com. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS station78.example.com.
78.0.168.192.in-addr.arpa. IN PTR station78.example.com.
3@@@@restart the named
[root@station78 named]# service named restart
Stopping named:
[ OK ]
Starting named: [ OK ]
[root@station78 named]# cat /etc/resolv.conf
# Generated by NetworkManager
domain jini.com.cn
search jini.com.cn example.com
nameserver 192.168.0.78
@@@
[root@station78 named]# dig example.com
; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53053
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
@@@
[root@station78 named]# dig -x 192.168.0.78
; <<>> DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6 <<>> -x 192.168.0.78
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33186
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
转载于:https://blog.51cto.com/majesty/806237