树莓派安装DNSMASQ服务

功能: DNSMASQ是一款高性能的、小型的DNS服务器软件。
* 缓存域名、IP地址,本地缓存解析的地址。
* DHCP服务

1.安装

sudo apt-get update
sudo apt-get install dnsmasq

2.配置

(1) 配置/etc/dnsmasq.conf

# dnsmasq.conf for raspberry pi
# /etc/dnsmasq.conf
# http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example

# Set up your local domain here
domain=raspberry.local
resolv-file=/etc/resolv.conf
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 if you dont want
# dnsmasq to serve up dhcpd requests.
# dhcp-range=192.168.0.100,192.168.0.149,255.255.255.0,1440m
# dhcp-option=3,192.168.0.1

(2) 配置 /etc/resolv.conf

# Generated by resolvconf
nameserver 127.0.0.1

可以自己增加nameserver ip 地址。

3.使用

启动:sudo service dnsmasq restart

树莓派中设置hostname为pi1。
PC机或手机中DNS中设置为:pi1.local

转载于:https://www.cnblogs.com/hyper99/p/shu-mei-pai-an-zhuangDNSMASQ-fu-wu.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值