usb共享网络 dns linux,Linux网络服务之DNS
发布日期:2021-10-27 11:20:50 浏览次数:7 分类:技术文章

本文共 1911 字,大约阅读时间需要 6 分钟。

准备:

加载光驱:mount /dev/cdrom /mnt/cdrom/

如需更换光盘请先卸载光驱:umount /mnt/cdrom 或 eject

解压bind包:tar  xzf bind-9.2.3.tar.gz -C /usr/local/src/

编译,配置和安装:cd /usr/local/src/bind-9.2.3

./configure--prefix=/usr/local/bind && make && make install

将程序安装盘的RedHat 9第二张光盘(RedHat AS 4 第一张光盘)放到光驱里,找到caching-nameserver-7.3-3.noarch.rpm

执行rpm ivh caching-nameserver-7.3-3.noarch.rpm --nodeps  (没有依赖关系)

生成rndc.key文件:/usr/local/bind/sbin/rndc-confgen > /etc/rndc.conf

mv /etc/rndc.conf /etc/rndc.key

编辑/etc/rndc.key

删除前四行以外的内容!!

配置文件:

主配置文件:/etc/named.conf

配置区域文件

切换到bind安装目录/usr/local/bind/sbin/目录下

检查主配置文件语法命令:

./named-checkconf /etc/named.conf

检查区域文件:

./named-checkzone  guoyuan.com /var/named/0.168.192

./named-checdzone guoyuan.com /var/named/guoyuan.com

看有没有错误,若没有错误则运行bind服务

运行:/usr/local/bind/sbin/named -c /etc/named.conf

若输入不输入 -c参数则出现named的所有参数。如

[root@host sbin]# ./named /etc/named.conf

usage: named [-c conffile] [-d debuglevel] [-f|-g] [-n number_of_cpus]

[-p port] [-s] [-t chrootdir] [-u username]

查看日志

tail -n 20 /var/log/messages

排除故障,

运行/usr/local/bind/sbin/named -c /etc/named.conf

查看进程:ps -aux|grep named

查看端口:netstat -an |grep 53

注:

1、区域文件要求设置NS记录(必须),mx记录,A 记录 CNAME记录

配置文件如:

$TTL    86400

@               IN SOA  test root.guoyuan.com. (

42              ; serial (d. adams)

3H              ; refresh

15M             ; retry

1W              ; expiry

1D )            ; minimum

IN NS           test.guoyuan.com.

test.guoyuan.com.       IN A            192.168.0.26

ftp                     IN A            192.168.0.24

webserver               IN A            192.168.0.3

IN A            192.168.0.26

IN A            192.168.4.2

www                     IN CNAME        webserver

mail                    IN A    192.168.0.26

@                       IN MX  5        mail

test1.guoyuan.com.      IN A 192.168.2.4

若要求批量加入域名如:station100.guoyuan.com ---station200.guoyuan.com在区域文件里加入下面语句:

$generate 100-200 station$.guoyuan.com. A 192.168.0.$

2、若开机是自动加载named:

用vi在/etc/rc.d/rc.local 文件里加入 /usr/local/bind/sbin/named -c /etc/named.conf

或者

输入echo "/usr/local/bind/sbin/named -c /etc/named.conf" >>/etc/rc.d/rc.local

两种形式均是向阳花/etc/rc.d/rc.local中写入"/usr/local/bind/sbin/named -c /etc/named.conf"这条语句!

转载地址:https://blog.csdn.net/weixin_34518190/article/details/116834426 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:linux yum源配置详解,配置YUM源的步骤(原理)
下一篇:linux火狐浏览器远程启动失败,Linux sh远程连接失败 sshd.service启动失败

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年03月02日 15时13分58秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章

php链接怎么截取,PHP 截取网页中的固定种子链接 2019-04-21
iis运行不起来php报500,解决IIS上安装thinkphp6运行报500错误 2019-04-21
php ajax上传图片过大500错误,javascript – JQuery AJAX文件上传错误500 2019-04-21
matlab 图中的legend,matlab中legend加图示命令的使用 2019-04-21
PHP exec xargs 不执行,Linux中的xargs命令及示例 2019-04-21
php 枚举cookie内容,php设置和获取cookie 2019-04-21
oracle 坏块查找,检测oracle数据库坏块的方法 2019-04-21
怎么对oracle 进行重装,重装oracle的方法 2019-04-21
oracle将memory_target改为自动管理方式,Oracle 11g新特性:Memory_target与自动内存管理... 2019-04-21
entlib连接oracle乱码,Connecting Oracle using ODP.NET with Enterprise Library DAAB 2019-04-21
php eol 没有换行,php_eol没有换行怎么办 2019-04-21
oracle sql plan baseline,sql plan baseline使用心得 2019-04-21
oracle历史数据归档工具,济南钢铁利用数据库归档工具提升Oracle数据库应用性能... 2019-04-21
oracle数据对象缓存,oracle优化缓存对象与数据 -电脑资料 2019-04-21
linux系统如何连接wf,Linux下如何通过命令连接wifi 2019-04-21
linux网卡传输数据卡死,linux – 网卡正在接收,但根本没有传输? 2019-04-21
红旗linux备份,更换红旗Linux: Asianux的yum源为网易源 2019-04-21
把视频接口写入HTML,html5 – MediaSource API – 将多个视频追加/连接到一个缓冲区中... 2019-04-21
cypress测试框架与selenium_后selenium时代Web UI自动化测试框cypress 2019-04-21
中兴力维动环监控接线图_肖东晖:动环是基本点 视频监控是增长点 2019-04-21