centos7搭建DNS服务器
来源:互联网 发布:帝国cms 自动刷新 编辑:程序博客网 时间:2024/05/21 09:43
在DNS服务器上
1、安装DNS服务器:bind
yum -y install bind bind-utils bind-chroot#安装bind bind-utils bind-chroot
rpm -qa |grep '^bind' #用rpm查看是否安装了bind bind-utils bind-chroot
vim /etc/named.conf # 修改配置文件named.conf
listen-on port 53 { any; } #监听任何主机53端口
allow-query {any;} #对任意用户开放
vim /etc/named.rfc1912.zones
zone "hadoop.com" IN {
type master;
file "named.hadoop.com";
allow-update { none; };
};
zone "20.168.192.in-addr.arpa" IN {
type master;
file "named.192.168.20.zone";
allow-update { none; };
};
2、正向解析文件
cd /var/named/
cp -p named.localhost named.hadoop.com //-p 保持文件权限不变
3、反向解析文件
cp -p named.localhost named.192.168.20.zone //与实际配置文件一致
4、在客户端的 /etc/sysconfig/network-scripts/
vim ifcfg-ens32
追加:DNS1=192.168.20.128
5、重启网络服务:service network restart
6、启动DNS服务器并且设置开机自启
systemctl start named.service
systenctl enable named.service
7、尝试解析user5.hadoop.com
nklookup user5.hadoop.com
遇到一些问题:
服务器端能正常解析但是客户端不能使用DNS解析
1、在/etc/resolv.conf文件中追加DNS服务器的位置
cd /etc
vim resolv.conf
nameserver 192.168.20.128
2、关闭防火墙并且关闭开机自启
systemctl stop firewalld.service#关闭防火墙
systemctl disable firewalld.service#禁止自启动
3、关闭selinux:
如果要永久关闭,可以修改配置文件/etc/selinux/config,将SELINU置为disabled。
- [root@rdo ~]# cat /etc/selinux/config
- # This file controls the state of SELinux on the system.
- # SELINUX= can take one of these three values:
- # enforcing - SELinux security policy is enforced.
- # permissive - SELinux prints warnings instead of enforcing.
- # disabled - No SELinux policy is loaded.
- #SELINUX=enforcing
- SELINUX=disabled
- # SELINUXTYPE= can take one of three two values:
- # targeted - Targeted processes are protected,
- # minimum - Modification of targeted policy. Only selected processes are protected.
- # mls - Multi Level Security protection.
- SELINUXTYPE=targeted
- centos7搭建DNS服务器
- CentOS7搭建DNS服务器
- centos7 搭建DNS服务器
- Centos7 DNS服务器搭建与配置
- 在 CentOS7.0 上搭建 Chroot 的 Bind DNS 服务器
- centos7下配置dns服务器
- CentOS7安装配置DNS服务器
- 搭建DNS服务器
- DNS服务器搭建
- CentOS DNS服务器搭建
- redhat dns服务器搭建
- 搭建DNS服务器
- DNS服务器搭建
- DNS服务器搭建笔记
- Linux 搭建DNS服务器
- Linux DNS服务器搭建
- 10.DNS服务器搭建
- DNS服务器搭建
- 高德地图地理码和经纬度转化(latlng和latlonpoint)
- 关于ubuntu和windows时间不同步问题
- Android 分享到qq和qq空间中的网页
- js判断输入框的值是否为空
- 射频识别技术漫谈(30)——PN512的寄存器设置
- centos7搭建DNS服务器
- Linux高级网络设置
- js和java中string的长度
- Win10一周年更新正式版安装方法大全
- 基础知识(一) HashMap 源码详解
- 分块与莫队
- Android的Finish后的代码继续执行
- 需求与实现职责划分怎样合理!
- MIME邮件的组织结构