博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux服务-bind
阅读量:5892 次
发布时间:2019-06-19

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

目录

Linux服务-Bind

1.安装bind

[root@cwh ~]# yum -y install bind*# 设置开机启动[root@cwh ~]# systemctl enable named

2.配置bind

[root@cwh ~]# vim /etc/named.confoptions {        listen-on port 53 { any; };//将大括号内的内容改成any        //listen-on-v6 port 53 { ::1; };        directory       "/var/named";        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";        allow-query     { any; };//将大括号内的内容改成any

3.添加正、反向解析域

3.1 指向生效的配置文件

[root@localhost ~]# vim /etc/named.rfc1912.zones//正向zone "cwhbind.com" IN {        type master;        file "cwhbind.com.zone";        allow-update { none; };};//反向zone "112.168.192.in-addr.arpa" IN {        type master;        file "112.168.192.zone";        allow-update { none; };};

3.2 生成配置文件cljhfy.com.zone163.168.192.zone

[root@localhost named]# vim cwhbind.com.zone $TTL 1D@  IN  SOA cwhbind.com.   admin.cwhbind.com. (            0   ; serial              1D  ; refresh              1H  ; retry              1W  ; expire             3H )    ; minimum         NS  www.cwhbind.com.        NS  ftp.cwhbind.com.        A  127.0.0.1        AAAA    ::1        MX  10 mx.cwhbind.com.ttl IN  A   192.168.112.149 //写配置bind的本机IPwww     IN  A   192.168.112.149 bbs IN  CNAME   wwwmx  IN  A   192.168.112.149ftp IN  A   192.168.112.149[root@localhost named]# vim 112.168.192.zone$TTL 1D@       IN      SOA     cwhbind.com. admin.cwhbind.com. (                         0                         2H                         10M                         7D                         1D )        NS  ttl.cwhbind.com.        A   127.0.0.1        AAAA    ::1149  IN      PTR     cwhbind.com.149  IN      PTR     www.cwhbind.com.149 IN      PTR     ftp.cwhbind.com.149  IN      PTR     mx.cwhbind.com.//配置完成后更改属主和属组还有给配置文件权限[root@localhost named]# chown named.named cwhbind.com.zone [root@localhost named]# chown named.named 112.168.192.zone [root@localhost named]# chmod 755 cwhbind.com.zone [root@localhost named]# chmod 755 112.168.192.zone //启动服务[root@localhost named]# systemctl start named-chroot

4.验证

[root@150 ~]# cat /etc/resolv.conf # Generated by NetworkManagernameserver 192.168.112.149//dns指向我设置好的IP[root@150 ~]# nslookup 192.168.112.149Server:     192.168.112.149Address:    192.168.112.149#53149.112.168.192.in-addr.arpa    name = ftp.cwhbind.com.149.112.168.192.in-addr.arpa    name = cwhbind.com.149.112.168.192.in-addr.arpa    name = mx.cwhbind.com.149.112.168.192.in-addr.arpa    name = www.cwhbind.com.[root@150 ~]# nslookup cwhbind.comServer:     192.168.112.149Address:    192.168.112.149#53Name:   cwhbind.comAddress: 127.0.0.1[root@150 ~]# nslookup ftp.cwhbind.comServer:     192.168.112.149Address:    192.168.112.149#53Name:   ftp.cwhbind.comAddress: 192.168.112.149[root@150 ~]# nslookup mx.cwhbind.comServer:     192.168.112.149Address:    192.168.112.149#53Name:   mx.cwhbind.comAddress: 192.168.112.149[root@150 ~]# nslookup www.cwhbind.comServer:     192.168.112.149Address:    192.168.112.149#53Name:   www.cwhbind.comAddress: 192.168.112.149//可以使用

转载于:https://www.cnblogs.com/chengweihong/p/10811300.html

你可能感兴趣的文章
asmx-web-service-basic-authentication
查看>>
Excel转换成图片的操作方法
查看>>
MFC中读取和设置文件状态
查看>>
分页显示
查看>>
iOS中安全结束 子线程 的方法
查看>>
批处理学习笔记8 - 深入学习For命令1
查看>>
Object-c学习之路二(oc内存管理黄金法则1)
查看>>
python开发_python文件操作
查看>>
iPhone 已停用
查看>>
CSS3之边框图片border-image
查看>>
图片轮换cycle插件的运用
查看>>
【Oracle】两个表Join关联更新
查看>>
ActiveX控件的安全初始化和脚本操作 和 数字签名SIGN
查看>>
关于IE下AJAX的问题探讨
查看>>
Eclipse console文本换行
查看>>
微信支付开发(11) Native支付
查看>>
HDFS dfsclient写文件过程 源码分析
查看>>
【设计模式】—— 代理模式Proxy
查看>>
ejabberd
查看>>
博客园博客自动生成三级目录(generate three levels content using JS in cnblogs)
查看>>