免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 921 | 回复: 0
打印 上一主题 下一主题

dns配置步骤 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-20 10:04 |只看该作者 |正序浏览
1. 设置主机名为node1
2. Vi /etc/hosts加入
192.168.0.1 node1
3.chkconfig list|grep named
4.chkconfig level 35 named on
下面的文件可以在/var/named/下拷贝产生。
test.com文件内容:
$TTL    86400
@       IN      SOA     node1.test.com. root.localhost.  (
                                      1997022701 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      node1.test.com.
node1 IN A 192.168.0.1
www IN CNAME node1.test.com.

0.168.192文件的内容:
$TTL    86400
@       IN      SOA     node1.test.com. root.localhost.  (
                                      1997022701 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      node1.test.com.
1       IN      PTR    node1.test.com.

named.local文件的内容:
$TTL    86400
@       IN      SOA     localhost. root.localhost.  (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum
              IN      NS      localhost.
1       IN      PTR     localhost.

named.conf文件的内容:(在/etc/下)
// generated by named-bootconf.pl

options {
    directory "/var/named";
   
    // query-source address * port 53;
};

//
// a caching only nameserver config
//
controls {
    inet 127.0.0.1 allow { localhost; } keys { rndckey; };
};
zone "." IN {
    type hint;
    file "named.ca";
};

zone "localhost" IN {
    type master;
    file "localhost.zone";
    allow-update { none; };
};

zone "0.0.127.in-addr.arpa" IN {
    type master;
    file "named.local";
    allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
    type master;
    file "0.168.192";
};
zone "test.com" IN {
    type master;
    file "test.com";
};
include "/etc/rndc.key";

resolv.conf文件的内容
domain test.com
nameserver 192.168.0.1
search test.com

nsswitch.conf文件中的改动:hosts:dns files

5.#service named start
6.测试
#nslookup
>www.test.com
>192.168.0.1
>127.0.0.1
#ping
www.test.com

#ping node1.test.com
#ping node1
#ping www.node1.test.com
#ping 192.168.0.1


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/6901/showart_102333.html
  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP