首页 > 系统相关 >centos搭建DNS服务器_bind9

centos搭建DNS服务器_bind9

时间:2023-03-09 10:34:37浏览次数:42  
标签:centos CentOS basearch infra mirrorlist releasever DNS bind9

1.更换清华源镜像

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

yum makecache

 

2.yum安装bind9

yum install bind*

 

3.修改配置文件

/etc/named.conf

 

//在options内修改如下

listen-on port 53 { 192.168.x.x; };  //修改ip为本机ip 非环回地址

// listen-on-v6 port 53 { ::1; };   注释掉ipv6

//添加转发dns优先

forward first;
forwarders {61.139.2.69;119.6.6.6;};

 

//在logging添加日志如下

logging {
channel default_debug {
file "data/named.run" versions 2000 size 50M;  //2000个文件  每个50M
severity info;
print-category yes;
print-time yes;
buffered yes;
};
category queries {  //将查询信息计入日志
default_debug;
};
};

 

4.设置开机启动

systemctl start named

systemctl enable named

标签:centos,CentOS,basearch,infra,mirrorlist,releasever,DNS,bind9
From: https://www.cnblogs.com/dxdxh/p/17197429.html

相关文章

  • VMware 下安装Centos7
    VMware下安装Centos71.前期准备​ 软件:VMware​ 下载地址:​​https://www.vmware.com/​​​ 安装直接一路点确认就行很简单的,我用的是16版本的​ 镜像:CentOS7​ 下载地......
  • systemd-nspawn 运行 centos7
    参考链接:https://www.shuzhiduo.com/A/E35p0VQE5v/建一个chroot的目录,例如:mkdir-p/path/to/chroot初始化rpm数据库:mkdir-p/path/to/chroot/var/lib/rpmrpm-......
  • Centos7安装Docker环境
    Dockerdaemon(Docker守护进程):运行在宿主机上,Docker守护进程,用户通过Dockerclient(Docker命令)与Dockerdaemon交互。Images(镜像):将软件环境打包好的模板,用来创建容......
  • centos7调整分辨率
    Centos7修改分辨率一.输入xrandr输入xrandr命令后可以看到系统的一些分辨率的列表,和当前系统屏幕的分辨率信息,可以通过命令的相应参数对系统分辨率的一些设置操作......
  • CentOS 7搭建http文件服务器
    yuminstallhttpdmysql-serverphpphp-mysqlrm-rf/etc/httpd/conf.d/welcome.confsystemctlretarthttpd文件存放目录var/www/html/解决中文乱码问题vi/etc......
  • centos8-x86_64安装kylinv10-arrch64
    1.vmwareesxi安装centos8,开启内核虚拟化2.安装qemu-system-arrch64操作:wgethttps://download.qemu.org/qemu-2.11.0.tar.xztarxvJfqemu-2.11.0.tar.xzcdqem......
  • Centos7 离线安装 MySQL 8.0.32
    1官网下载mysql离线rpm包下载地址:https://dev.mysql.com/downloads/mysql/2将下载的tar包上传到/opt/rpm/mysql目录 3删除CentOS自带的mariadb 说明:不删的话my......
  • centos7 使用docker-compose搭建hadoop集群
    1,安装docker和docker-compose2,在linux服务器上创建hadoop文件夹,在hadoop文件夹下创建docker-compose.yml文件docker-compose.yml文件内容如下:version:'3'services:......
  • CentOS7使用cp命令覆盖时不提示
    平常使用中bbb这个文件存在,想要使用cp命令把aaa文件的内容覆盖到bbb文件中,就会使用cp-faaabbb-f 的意思是遇到同名的文件,不提示,直接覆盖但是还是会提示[roo......
  • CentOS-7-x86_64-DVD-1810
    1.点击安装 第一个选项是直接安装。 第二个选项是需不需要检测镜像。 我们选择第一个直接安装。2.选择语言3.4.5. ......