搜尋此網誌
RHCE - DNS Server 區網內架設
DNS Server
環境:
[root@instructor]
hostname = instructor.example.com
IPADDR=192.168.122.1 (DNS Server)
[root@desktop]
hostname = desktop
IPADDR=192.168.122.3
[root@Vserver]
hostname = Vserver
IPADDR=192.168.122.103
[root@instructor]# yum install bind
在 /etc/named.conf 底下新增兩的zone
#整解的ZONE,存放路徑為 /var/named/named.example.com
zone "example.com" IN {
type master;
file "named.example.com";
allow-update { none; };
};
#反解的ZONE,存放路徑為 /var/named/named.192.168.122
zone "122.168.192.in-addr.arpa" IN {
type master;
file "named.192.168.122";
allow-update { none; };
};
#vim /var/named/named.example.com (正解)
$TTL 86400
@ IN SOA instructor.example.com. root.instructor (
2
604800
86400
2419200
6048000 )
@ IN NS instructor.example.com.
instructor IN A 192.168.122.1
i IN CNAME instructor.example.com.
desktop IN A 192.168.122.3
Vserver IN A 192.168.122.103
www3 IN A 192.168.122.103
host3 IN A 192.168.122.103
#vim /var/named/named.192.168.122 (反解)
$TTL 86400
@ IN SOA instructor.example.com. root.instructor (
2
604800
86400
2419200
6048000 )
@ IN NS instructor.example.com.
1 IN PTR instructor.example.com.
3 IN PTR desktop
103 IN PTR Vserver
103 IN PTR www3
103 IN PTR host3
#service named start
[root@desktop]# vim /etc/resolv.conf
加入下面兩行
search example.com
nameserver 192.168.122.1
[root@Vserver]# vim /etc/resolv.conf
加入下面兩行
search example.com
nameserver 192.168.122.1