自建网络加速服务器,自建DNS缓存服务器加快上网速度

我们在浏览网页时,首先要通过DNS服务器来解析网站的地址,解析的时间虽然比较短,但如果DNS服务器的响应速度比较慢,或者DNS请求量过大,都会导致上网时等待时间过长,我们这里通过自己建立轻量级缓存DNS服务器来加快上网速度。同时,自建DNS服务器还可以避免DNS投毒,通过服务器来加快上网速度,提升上网体验。

首先安装dnsmasq这款软件,它可以将访问过的地址存储在本地,这样当给你再次访问这个网址时,就不用请求上级DNS服务器,极大的提高解析速度。

安装dnsmasq:

sudo apt-getinstall -y dnsmasq

接下来需要配置dnsmasq,打开dnsmasq的配置文件,路径一般是/etc/dnsmasq.conf,配置示例如下:

# Dnsmasq.conf

# /etc/dnsmasq.conf

#http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example

# Set up your local domain here

domain=lxx1.com

resolv-file=/etc/resolv.dnsmasq

min-port=4096

server=8.8.8.8

server=8.8.4.4

# Max cache size dnsmasq can give us, and we want all of it!

cache-size=10000

# Below are settings for dhcp. Comment them out

原文链接:https://blog.csdn.net/weixin_30436581/article/details/119262793

原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/22227

(0)
上一篇 2023年8月13日
下一篇 2023年8月14日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

优速盾注册领取大礼包www.cdnb.net
/sitemap.xml