Dnsmasq  官网 http://www.thekelleys.org.uk/dnsmasq/doc.html

Unbuntu 安装 Dnsmasq 参见 https://help.ubuntu.com/community/Dnsmasq

一.  介绍

  DNSmasq 提供两种服务,每种服务可以单独运行:

  1. DNS 服务
  2. DHCP 服务

  本地 DNS 缓存可以加速网络访问,因为用户的浏览器不需要对先前查询过域名再次向 DNS服务器查询。

  DNCP 允许用户的电脑为同一个无线或有限环境中的其他计算机分配 IP 地址。

二. 安装

$ sudo apt-get install dnsmasq 

三. 配置

dnsmasq 配置文件地址

$ /etc/dnsmasq.conf

本地 DNS 缓存设置

修改

#listen-address=

listen-address=127.0.0.1

接下来修改 /etc/resolv.conf,确保新设置的 DNS 服务器 127.0.0.1 出现在 DNS 服务器列表的顶端。无论何时用户的电脑需要解析一个域名,它会首先请求 dnsmasq (其跑在 127.0.0.1) 

$ cat  /etc/resolv.conf
search yourisp.com
nameserver 127.0.0.1
nameserver 192.168.0.1
nameserver 205.171.3.25
nameserver 205.171.3.26

 修改后配置后重启服务生效

$ sudo /etc/init.d/dnsmasq restart

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2021-12-11
  • 2021-12-06
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案