DNS简配

一、安装包
         bind-9.3......rpm
         bind-chroot-9.3......rpm
         bind-devel-9.3.......rpm
         caching-nameserver-9.3.....rpm
 
二、配置<只显示修改后的内容>
1.#vi /etc/reslov.conf
添加nameserver 192.168.1.100<本机IP作DNS服务器>
 
2.#vi /etc/sysconfig/network
修改HOSTNAME=linux.example.com<根据实际情况修改>
 
3.#vi /etc/hosts<可不做>
添加192.168.1.100      linux.example.com       linux
 
4.#vi /etc/named.rfc1912.zones
最下面添加zone
zone "example.com" IN {
        type master;
        file "example.com";
        allow-update { none; };
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "named.1.168.192";
        allow-update { none; };
};
 
5.#vi /etc/named.caching-nameserver.conf
把下列列出的改为
            listen-on port 53 { any; };
        listen-on-v6 port 53 { any; };                <支持ip V6用>
        allow-query     { any; };
        allow-query-cache { any; };
        match-clients      { any; };
        match-destinations { any; };
 
6.#cd /var/named/chroot/var/named/
   #cp named.local    named.1.168.192   
   #cp named.zero    example.com
<这两个文件名需与named.rfc1912.zones 中指定的相同>
 
7.#vi  named.1.168.192
修改为
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
@        IN      NS       linux.example.com.
100      IN      PTR     linux.example.com.
@        IN      MX   5  mail.example.com.
100      IN      PTR     mail.example.com.
100      IN      PTR     www.example.com .
 
   #vi  example.com
修改为
$TTL    86400
@               IN SOA  localhost.      root.localhost. (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum
@       IN      NS      linux.example.com.
linux.example.com.    IN      A       192.168.1.100
@       IN      MX   5  mail.example.com.
mail     IN      A        192.168.1.100
www     IN      A       192.168.1.100
 
注意一下几点:
①.上面两个配置文件出现的网址后面必须以“.”结尾
②.named.1.168.192与example.com所属组必须为named
 
 
 

你可能感兴趣的:(职场,dns,休闲)