免费注册 查看新帖 |

Chinaunix

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

BIND 9 例子 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-02-25 22:30 |只看该作者 |倒序浏览

Postfix Integrated Solution

域名
[url=http://docs.huihoo.com/internet/postfix/pis/c324.html]Next >>>

BIND 9 例子
目前我不打算介绍如何配置Bind,Windows DNS Server,主要是没有时间去写,以后我会加上.
我做过Bind 9做主DNS,windows DNS Server 做辅助DNS,让他们同步数据. 这样可以在WIN DNS看到域名信息,比较直观,也很方便。如果你有兴趣可以自己做试验
这里我只给出一个例子。首先配置/etc/resolv.conf文件
[root@linux src]# cat /etc/resolv.conf
nameserver 127.0.0.1
nameserver 202.96.128.68
nameserver 218.30.103.50
nameserver 202.106.169.100
[root@linux src]#
               
配置/etc/named.conf文件
[root@linux src]# cat /etc/named.conf
// generated by named-bootconf.pl
options {
        directory "/var/named";
        /*
         * If there is a firewall between you and nameservers you want
         * to talk to, you might need to uncomment the query-source
         * directive below.  Previous versions of BIND always asked
         * questions using port 53, but BIND 8.1 uses an unprivileged
         * port by default.
         */
        // 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 "example.net" IN {
        type master;
        file "example.net";
        allow-update { none; };
};

include "/etc/rndc.key";
               
创建文件/var/named/example.net
[root@linux src]# cat /var/named/example.net
@ IN SOA        example.net. root.example.net. (
                          200211131 ; serial, todays date + todays serial #
                          28800 ; refresh, seconds
                          7200 ; retry, seconds
                          3600000 ; expire, seconds
                          86400 ) ; minimum, seconds
        NS ns.example.net.
@       IN A         192.168.0.1
www     IN A         192.168.0.1
mail    IN A         192.168.0.1
@       MX 10 mail.example.net.
[root@linux src]#
               
重新启动BIND(DNS 服务器)
[root@linux src]# service named restart
Stopping named:
[root@linux src]#                                          [  OK  ]
               
测试
[root@linux src]# ping example.net
PING example.net (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.030 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.018 ms
--- example.net ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 7201ms
rtt min/avg/max/mdev = 0.018/0.024/0.030/0.007 ms
[root@linux src]# ping mail.example.net
PING mail.example.net (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.022 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.036 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.032 ms
--- mail.example.net ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1998ms
rtt min/avg/max/mdev = 0.022/0.030/0.036/0.005 ms
               

[url=http://docs.huihoo.com/internet/postfix/pis/book1.html]Home

Next >>>
域名
Up
OpenLDAP

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/16907/showart_249783.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP