dnsmasq dns缓存_将Dnsmasq安装为缓存Dns服务器

dnsmasq dns缓存

dnsmasq dns缓存

We have a lot of computer in our network. Our network speed is not too much. Sometimes especially in mornings our internet connection slows down. How can solve this with some dns related tricks? Dns is one of the mostly used network protocol. It can effect the internet speed. Making some optimizations will develop your internet experience. Caching is to hold resolved dns queries in our dns server. There are different type and feature dns servers in the wild. Dnsmasq is one them which is very light. Dnsmasq can be used tftp and dhcp server too.

我们的网络中有很多计算机。 我们的网络速度不是太快。 有时,特别是在早晨,我们的互联网连接速度变慢。 如何用一些与DNS相关的技巧解决此问题? Dns是最常用的网络协议之一。 它会影响互联网速度。 进行一些优化将发展您的互联网体验。 缓存是将解析的dns查询保存在我们的dns服务器中。 野外有不同类型和功能的dns服务器。 Dnsmasq是其中之一,非常轻巧。 Dnsmasq也可以用于tftp和dhcp服务器。

安装 (Install)

We can install dnsmasq easily like below.

我们可以像下面那样轻松安装dnsmasq。

Ubuntu,Debian,Kali (Ubuntu, Debian, Kali)

$ sudo apt-get install dnsmasq
Install dnsmasq
Install dnsmasq
安装dnsmasq

CentOS,Fedora (CentOS, Fedora)

$ sudo yum install dnsmasq

添加新的DNS服务器 (Add New DNS Server)

Add new dns servers for the next hop for dnsmasq. Keep in mind to add these configuration we need root privilege

为dnsmasq的下一跳添加新的dns服务器。 记住要添加这些配置,我们需要root特权

$ echo "nameserver 8.8.8.8" >> /etc/resolv.conf 
$ cat /etc/resolv.conf  
; generated by /usr/sbin/dhclient-script 
nameserver 192.168.122.1 
nameserver 8.8.8.8

重新启动Dnsmasq (Restart Dnsmasq)

By default dnsmasq is not started after installation. We will start the dnsmasq with the  systemctl restart command like below.

默认情况下, dnsmasq在安装后不会启动。 我们将使用如下所示的systemctl restart命令启动dnsmasq。

$ systemctl restart dnsmasq

用挖测试 (Test With Dig)

In order to see whether the dnsmasq is active we will use dig for domain name query. We will make a dns query for www.poftut.com

为了查看dnsmasq是否处于活动状态,我们将使用dig进行域名查询。 我们将对www.poftut.com进行DNS查询

$ dig www.poftut.com
Test With Dig
Test With Dig
用挖测试

DNS要求dnsmasq(DNS Request To dnsmasq)

In the first DNS request this will be returned from the global DNS servers and stored in the dnsmasq . If we resolve in the second time the same domain name this will be returned from dnsmasq . This will make

在第一个DNS请求中,它将从全局DNS服务器返回并存储在dnsmasq 。 如果我们第二次解析相同的域名,它将从dnsmasq返回。 这将使

$ dig www.poftut.com
DNS Request To dnsmasq
DNS Request To dnsmasq
DNS要求dnsmasq

We can see that Query time: is about 67 miliseconds which is better than from previous DNS request which is 211 miliseconds.

我们可以看到Query time:大约67毫秒,比之前的DNS请求的211毫秒要好。

LEARN MORE  Windows Performance Recorder (wpr) Command Tutorial with Examples To Record Performance Metrics
了解更多Windows Performance Recorder(wpr)命令教程,并带有记录性能指标的示例

将Dnsmasq安装为缓存Dns服务器信息(Install Dnsmasq As Cache Dns Server Infografic)

Install Dnsmasq As Cache Dns Server Infografic

翻译自: https://www.poftut.com/install-dnsmasq-cache-dns-server/

dnsmasq dns缓存

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值