如何把本地 hosts 文件写到 openwrt

2025-06-27 00:17:27
推荐回答(1个)
回答1:

配置 dnsmasq 就行了

修改 /etc/dnsmasq.conf 添加如下
address=/www.xxx.com/192.168.1.100

写 /etc/dnsmasq.d 下的话需要 conf-dir=/etc/dnsmasq.d
这个配置是高优先级的,就是不会去递归查询了,直接返回结果。