广告
返回顶部
首页 > 资讯 > 后端开发 > Python >Centos 7安装unbound
  • 294
分享到

Centos 7安装unbound

Centosunbound 2023-01-30 21:01:53 294人浏览 独家记忆

Python 官方文档:入门教程 => 点击学习

摘要

1.关闭firewall:#停止firewallsystemctl stop firewalld.service#禁止firewall开机启动systemctl disable firewalld.service2.永久关闭vi /etc/

1.关闭firewall:

#停止firewall

systemctl stop firewalld.service

#禁止firewall开机启动

systemctl disable firewalld.service


2.永久关闭

vi /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled 

设置后需要重启才能生效


下面开始正式安装unbound

3.安装unbound

yum -y install unbound

清理缓存

yum clean all

重启服务

systemctl restart unbound  

设置开机启动

systemctl enable unbound


4.备份配置文件

cd /etc/unbound/

mv unbound.conf unbound.conf.bak

5.编辑配置文件

vim unbound.conf

注释的地方,全部被我删除了!

完整内容如下:


server:

verbosity: 1

statistics-interval: 0

statistics-cumulative: no

extended-statistics: yes

num-threads: 2

#监听地址

interface: 0.0.0.0


interface-automatic: no

#让所有主机能够向本机查询DNS

access-control: 0.0.0.0/0 allow

chroot: ""

#安全起见,禁用服务用户(DNS 的服务用户为 unbound)

username: ""

directory: "/etc/unbound"

log-time-ascii: yes

pidfile: "/var/run/unbound/unbound.pid"

harden-glue: yes

harden-dnssec-stripped: yes

harden-below-nxdomain: yes

harden-referral-path: yes

use-caps-for-id: no

unwanted-reply-threshold: 10000000

prefetch: yes

prefetch-key: yes

rrset-roundrobin: yes

minimal-responses: yes

trusted-keys-file: /etc/unbound/keys.d/*.key

auto-trust-anchor-file: "/var/lib/unbound/root.key"

val-clean-additional: yes

val-permissive-mode: no

val-log-level: 1

include: /etc/unbound/local.d/*.conf

remote-control:

control-enable: yes

server-key-file: "/etc/unbound/unbound_server.key"

server-cert-file: "/etc/unbound/unbound_server.pem"

control-key-file: "/etc/unbound/unbound_control.key"

control-cert-file: "/etc/unbound/unbound_control.pem"

include: /etc/unbound/conf.d/*.conf


6.验证配置文件是否正确

unbound-checkconf

提示以下内容,就说明没有错误

unbound-checkconf: no errors in /etc/unbound/unbound.conf


重启unbound服务

systemctl restart unbound

7.查看监听端口,53号端口是否存在

[root@localhost unbound]# netstat -tuNLP |grep unbound

tcp        0      0 0.0.0.0:53              0.0.0.0:*               LISTEN      2382/unbound        

tcp        0      0 127.0.0.1:8953          0.0.0.0:*               LISTEN      2382/unbound        

tcp6       0      0 ::1:8953                :::*                    LISTEN      2382/unbound        

udp        0      0 0.0.0.0:53              0.0.0.0:*                           2382/unbound  


8.创建新的配置文件,这里以example.com为例:

vim /etc/unbound/local.d/example.conf

内容如下:


local-zone: "example.com." static

local-data: "example.com. 86400 IN SOA ns.example.com. root 1 1D 1H 1W 1H"

local-data: "ns.example.com. IN A 192.168.10.10"

local-data: "linuxprobe.example.com. IN A 192.168.10.10"

local-data-ptr: "192.168.10.10 ns.example.com."

local-data-ptr: "192.168.10.10 linuxprobe.example.com."


9.编辑本机网卡配置文件

vim /etc/sysconfig/network-scripts/ifcfg-eth0

主要配置如下:

.....

#系统启动时激活网卡

ONBOOT=yes

#静态IP地址

IPADDR="192.168.78.133"

#子网掩码

PREFIX="24"

#网关地址

GATEWAY="192.168.78.2"

#DNS地址,指向本机

DNS1=192.168.78.133


重启网络服务

systemctl restart network


10.安装解析工具

yum install -y bind-utils

测试解析

[root@localhost ~]# nslookup 

> linuxprobe.example.com.

Server:192.168.78.133

Address:192.168.78.133#53


Name:linuxprobe.example.com

Address: 192.168.10.10

> exit


域名解析正确!!!





--结束END--

本文标题: Centos 7安装unbound

本文链接: https://www.lsjlt.com/news/178907.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Centos 7安装unbound
    1.关闭firewall:#停止firewallsystemctl stop firewalld.service#禁止firewall开机启动systemctl disable firewalld.service2.永久关闭vi /etc/...
    99+
    2023-01-30
    Centos unbound
  • Centos 7 安装RocksDB
    1、安装依赖yum -y install lrzsz git gcc gcc-c++ lz4-devel  yum -y install snappy snappy-devel zlib zlib-deve...
    99+
    2022-10-18
  • CentOS 7安装Docker
    若无linux系统,详见https://www.jb51.net/article/232585.htm 进行下载安装 工欲善其事,必先利其器,为方便传输文件与复制粘贴,需要先安装几个的工具: 1、linux中安装ssh ...
    99+
    2022-06-04
    CentOS安装Docker Linux安装Docker
  • centos 7 安装python3
    yum install openssl-devel -y wget https://www.python.org/ftp/python/3.6.8/Python-3.6.8.tgz tar zxvf Python...
    99+
    2023-01-31
    centos
  • centos 7 安装python3.6
    centos7 默认安装了python2.7.5,当需要使用python3的时候,可以手动下载python源码后编译安装.python 官网:www.python.org1.安装python可能用到的依赖yum install openss...
    99+
    2023-01-31
    centos
  • CentOS 7 安装宝塔
    哈喽大家好,这篇文章将向大家介绍如何在自己的服务器上安装宝塔。       注意:服务器必须为没有安装过任何软件的纯净环境,如果不是则需要前往控制台重装系统(尤其是安装过Apache/Nginx、MySQL、PHP等)       这里我们...
    99+
    2023-10-23
    centos 服务器 linux
  • CentOS 7 安装 postgreSQL 9.4
    CentOS 7仓库中的postgresql软件包太老,我们希望从postgresql 官方获取支持,尤其是关于postgresql 集群方面的支持,比如pgpool 。安装postgresql 9.4yu...
    99+
    2022-10-18
  • CentOS 7 安装Owncloud 9.1.3
    首先安装好CentOS系统,系统的安装这里就不介绍了安装完之后首先配置好IP地址# vi /etc/sysconfig/network-scripts/ifcfg-eth0   BOOT...
    99+
    2022-10-18
  • CentOS 7 安装 Oracle 11.2.0.4
    本文转自: https://www.cnblogs.com/xqzt/p/5456401.html 但结合实际情况,内容稍有改动。 一、安装环境 CentOS Linux release 7.2.1511...
    99+
    2022-10-18
  • CentOS 7下安装Python3.6
    •安装python3.6可能使用的依赖 yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel   •到python...
    99+
    2023-01-30
    CentOS
  • centos 7 下安装python3
    http://www.linuxidc.com/Linux/2016-04/129784.htm 这篇文章的确不错...
    99+
    2023-01-31
    centos
  • centos 7 yum 安装 pyth
    sudo yum install epel-releasesudo yum install python34...
    99+
    2023-01-31
    centos yum pyth
  • CentOS 7 下安装 Python
    当前最新的 CentOS 7.3 默认安装的是 Python 2 ,并且默认的官方 yum 源中不提供 Python 3 的安装包。最近需要在机器上装awscli,需要python2.6.5+或python3.3+,python3我这边通...
    99+
    2023-01-31
    CentOS Python
  • Centos 7安装 redmine 3
    一、配置网卡,能够访问互联网(略)========================================================二、配置环境yum -y install patch make gcc gcc-c++ gcc...
    99+
    2023-01-31
    Centos redmine
  • Centos 7安装mysql-5.7.22
    注意:5.7.20版本之后,默认不带my.cnf配置文件!安装epel更新源(对应系统版本)下载epel文件epel-release-latest-7.noarch.rpmwget https://mirrors.aliyun.com/ep...
    99+
    2023-01-30
    mysql Centos
  • centos 7 安装python3和P
    一、添加epel源yum install epel-release二、安装Python3.4,装完再升级吧yum install python34三、安装pip3yum install python34-setuptoolseasy_ins...
    99+
    2023-01-31
    centos
  • centos 7怎么安装php
    本文操作环境:centos7系统、PHP7.2版、DELL G3电脑centos7怎么安装php?Centos7安装PHP7.2建议方法# 安装EPEL yum存储库 yum install epel-release -y # 安装Re...
    99+
    2017-06-11
    contos7
  • CentOS 7 安装 cacti 1.1.x
    由于cacti 1.1.x系列发布后,变化比较大,集成了很多插件,自带自动发现功能,所以记录下来,比较适合复制粘贴。环境:CentOS 7.4安装前提a、安装系统补丁yum update...
    99+
    2022-10-18
  • CentOS 7上安装Python 3.
    CentOS 7默认安装了Python 2.7,系统本身也使用它来启用系统命令例如‘yum’ 虽然作为开发人员我可以用Python 2.7做很多事情,但我真的想要利用Python 3附带的新语言功能。自从Python 3.6在去年年底问世以...
    99+
    2023-01-31
    CentOS Python
  • Centos 7 安装python 版本
    #/root/.pyenv/shims/python     #python 3.0 # -*- coding:UTF-8 -*- import os import sys class Package():     def install...
    99+
    2023-01-31
    版本 Centos python
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作