VMware下Linux快速配置本机的DNS域

[root@mail ~]# mount /dev/hdc /mnt(挂载镜像文件)
mount: block device /dev/hdc is write-protected, mounting read-only

[root@mail ~]# cd /mnt/Server/(进入安装目录,(rpm -ivh)安装上以下find出来的套件)
[root@mail Server]# find -name "bind*"
./bind-9.3.6-4.P1.el5.i386.rpm
./bind-chroot-9.3.6-4.P1.el5.i386.rpm
./bind-devel-9.3.6-4.P1.el5.i386.rpm
./bind-libbind-devel-9.3.6-4.P1.el5.i386.rpm
./bind-libs-9.3.6-4.P1.el5.i386.rpm
./bind-sdb-9.3.6-4.P1.el5.i386.rpm
./bind-utils-9.3.6-4.P1.el5.i386.rpm

[root@mail Server]# find -name "cach*"
./caching-nameserver-9.3.6-4.P1.el5.i386.rpm
2、修改配置文件

[root@mail ~]# vi /etc/named.caching-nameserver.conf (修改其中的监听范围,由本机改为any)

options {
        listen-on port 53 { any; };(监听所有IPV4地址,当然可以修改成自己需要的)
        listen-on-v6 port 53 { any; };
        directory       "/var/named";

forwarders{202.102.240.65;};(这里可以设置DNS的托管,202.102.240.65为所在学校的DNS服务器地址)
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";

// Those options should be used carefully because they disable port
        // randomization
        // query-source    port 53;
        // query-source-v6 port 53;

allow-query     { any; };
        allow-query-cache { any; };
};
logging {
        channel default_debug {
                file "data/named.run";
                severity dynamic;
        };
};
view localhost_resolver {
        match-clients      { any; };
        match-destinations { any; };
        recursion yes;
        include "/etc/named.rfc1912.zones";
};
[root@mail ~]# vi /etc/named.rfc1912.zones (建立域,添加主域名为linuxidc.com的域)

zone "linuxidc.com" IN {
        type master;
        file "named.linuxidc";
};
zone "1.168.192.in-addr.arpa" IN {
        type master;
        file "named.192.168.1";
};
3、建立正反解的对应文档
[root@mail ~]# cd /var/named/chroot/var/named/
[root@mail named]# cp named.local named.linuxidc (利用模板复制再修改)

[root@mail named]# cp named.local named.192.168.1
[root@mail named]# chown named:named named.linuxidc (修改uid和gid)

[root@mail named]# chown named:named named.192.168.1 (修改uid和gid)

[root@mail named]# vi named.linuxidc (设置正解,其中MX为邮件徽记,用于配置邮件服务器的MTA)
$TTL    86400
@               IN SOA  @       root (
                                        42              ; serial (d. adams)
                                        3H              ; refresh
                                        15M             ; retry
                                        1W              ; expiry
                                        1D )            ; minimum

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ppzjd.html