需要一个简单的dns转发装服务器上自用
- sudo apt install dnsmasq -y
- ---------------
- 新建或者编辑 `/etc/dnsmasq.d/port5353.conf`:
- port=5353
- # 监听地址,按需放开局域网
- listen-address=0.0.0.0,127.0.0.1,10.2.0.6
- # 不读取系统 resolv.conf
- no-resolv
- no-poll
- # 上游:本机 127.0.0.1 端口 53
- server=183.60.83.19#53
- server=183.60.82.98#53
- # 关闭缓存(如果你要纯转发)
- cache-size=0
- --------------
- 重启并检查:
- ```
- sudo systemctl restart dnsmasq
- sudo systemctl enable dnsmasq
- ss -ulnp | grep dnsmasq
- # 测试
- dig @127.0.0.1 -p 5353 baidu.com
复制代码
|