192.168.10.1注解,192.168.0.1与192.168.0.111区别

首页 > 实用技巧 > 作者:YD1662023-12-20 08:10:51

前言

unbound是一个验证、递归和缓存DNS解析器,是一个开源local dns,支持edns-client-subnet(bind不支持edns-client-subnet)。

192.168.10.1注解,192.168.0.1与192.168.0.111区别(1)

官网地址:http://unbound.net/index.html

下载地址:http://unbound.net/download.html


安装

192.168.10.1注解,192.168.0.1与192.168.0.111区别(2)

将安装路径设置到/opt/unbound

tar zxvf unbound-1.6.8.tar.gz

cd unbound-1.6.8

./configure --prefix=/opt/unbound

make

make install


创建运行用户

groupadd unbound

useradd -s /sbin/nologin -M unbound


配置文件

vim /opt/unbound/etc/unbound/unbound.conf

server:

verbosity: 1

num-threads: 2 #线程数

interface: 127.0.0.1 #监听地址(一般写本机内网ip)

interface: 192.168.3.10 #监听地址(一般写本机内网ip)

interface: ::0

port: 53 #端口

so-reuseport: yes #为每个线程的传入查询打开专用侦听套接字。可以更均匀地将传入查询分布到线程

cache-min-ttl: 60 #解析最小缓存时间

cache-max-ttl: 600 #解析最大缓存时间

outgoing-range: 8192

access-control: 192.0.0.0/8 allow #访问控制(允许10段ip访问本机)

access-control: 127.0.0.1/8 allow #允许本机访问

access-control: ::0/0 allow #允许ipv6网段访问

prefetch: yes #消息缓存元素在它们到期之前被预取以保持缓存是最新的

do-ip4: yes

do-ip6: yes

do-udp: yes

do-TCP: yes

do-daemonize: yes

so-rcvbuf: 8m

so-sndbuf: 8m

msg-cache-size: 64m #消息缓存的字节数。 默认值为4 MB。

rrset-cache-size: 128m #RRset缓存的字节数。

outgoing-num-tcp: 256 #为每个线程分配的传出TCP缓冲区数

incoming-num-tcp: 1024 #为每个线程分配的传入TCP缓冲区数

include: "/opt/unbound/etc/unbound/zone.conf" #zone.conf文件内容为解析内容,如local-data: "m.baidu.com A 192.168.10.1",也可以使用下面注释的方式配置解析

# local-data: "m.baidu.com 600 A 192.168.10.1" #其中600为解析缓存时间

#python:

remote-control: #这个区间为unbound控制设置。配置如下内容可以控制unbound服务,利用unbound-control命令对该服务执行开启、关闭、重启等操作。

control-enable: yes

control-interface: 127.0.0.1

control-port: 8953

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

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

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

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

forward-zone: #这个区间为转发设置

name: "."

forward-addr: 8.8.8.8


生成密钥

/opt/unbound/sbin/unbound-control-setup


检查配置文件

/opt/unbound/sbin/unbound-checkconf


启动服务

/opt/unbound/sbin/unbound -c /opt/unbound/etc/unbound/unbound.conf

192.168.10.1注解,192.168.0.1与192.168.0.111区别(3)

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.