第一范文网 - 专业文章范例文档资料分享平台

配置示例DNS-BIND9

来源:用户分享 时间:2025/5/18 6:49:25 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

ns1 IN A 192.168.25.188 ns2 IN A 192.168.25.168 abc IN A 192.168.25.188 www IN A 192.168.25.1 mail IN A 192.168.25.2 db IN A 192.168.25.3 ftp IN A 192.168.25.3 proxy IN A 192.168.25.4

2. 启动 DNS

2.1、创建启动文件 /etc/rc.d/init.d/named

#!/bin/sh #

# This shell script takes care of starting and stopping named (BIND DNS server). #

# chkconfig: 345 55 45

# description: named (BIND) is a Domain Name Server (DNS) \\ # that is used to resolve host names to IP addresses. # probe: true

# Source function library. . /etc/rc.d/init.d/functions

# Source networking configuration. . /etc/sysconfig/network

# Check that networking is up.

[ ${NETWORKING} = \

[ -f /usr/sbin/named ] || exit 0

[ -f /etc/named.conf ] || exit 0

# See how we were called. case \ start)

# Start daemons.

echo -n \ daemon named echo

touch /var/lock/subsys/named

;; stop)

# Stop daemons.

echo -n \ killproc named

rm -f /var/lock/subsys/named echo ;; status)

/usr/sbin/rndc status exit $? ;; restart)

/usr/sbin/rndc restart exit $? ;; reload)

/usr/sbin/rndc reload exit $? ;; probe)

# named knows how to reload intelligently; we don't want linuxconf # to offer to restart every time

/usr/sbin/rndc reload >/dev/null 2>&1 || echo start exit 0 ;;

*)

echo \ exit 1 esac

exit 0

2.2、创建 symbollink

$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc0.d/K45named $ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc1.d/K45named $ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc2.d/K45named $ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc3.d/S55named $ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc4.d/S55named $ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc5.d/S55named

$ ln -s /etc/rc.d/init.d/named /etc/rc.d/rc6.d/K45named

2.3、启动/停止

$ tail -f /var/log/messages &

$ /etc/rc.d/init.d/named start //Start the name server

$ /etc/rc.d/init.d/named stop //Stop the name server

3. 测试 3.1. 检查

$ sbin/named-checkconf

$ sbin/named-checkzone zonename zonefilename

3.2. nslookup 测试

在LINUX 系统中,测试前必需编辑/etc/resolv.conf 文件: #cd /etc

#vi resolv.conf

search test.com

nameserver 192.168.25.188

然后再用 nslookup测试. # nslookup

Note: nslookup is deprecated and may be removed from future releases. Consider using the `dig' or `host' programs instead. Run nslookup with the `-sil[ent]' option to prevent this message from appearing. >

> set all

Default server: 192.168.25.188 Address: 192.168.25.188#53

Set options:

novc nodebug nod2 search recurse

timeout = 0 retry = 2 port = 53 querytype = A class = IN srchlist = test.com >

> ns1

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: ns1.test.com Address: 192.168.25.188 >

> ns2

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: ns2.test.com Address: 192.168.25.168 >

> www

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: www.test.com Address: 192.168.25.1 >

> mail

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: mail.test.com Address: 192.168.25.2 > > db

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: db.test.com Address: 192.168.25.3 >

> ftp

Server: 192.168.25.188 Address: 192.168.25.188#53

Name: ftp.test.com Address: 192.168.25.4 >

> proxy

Server: 192.168.25.188 Address: 192.168.25.188#53

搜索更多关于: 配置示例DNS-BIND9 的文档
配置示例DNS-BIND9.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2v6a32t4jr207lq1baeo_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top