有域名 example.com,对应地址为 1.2.3.4,现在需要将 example.com 的所有子域名也(强制)解析到 1.2.3.4
路由器 OpenWrt,DNS 服务器使用 dnsmasq
dnsmasq 支持这种 wildcard 设置,需要添加 address 字段
SSH 到路由器,编辑 /etc/config/dhcp,在 config dnsmasq 配置下添加
list address '/example.com/1.2.3.4'
最后重启 dnsmaq 即可,测试不会影响 passwall 运行
我的 OpenWrt LuCI Web 界面下(网络 - DHCP/DNS)没有 dnsmasq 的 Addresses 配置项,所以需要 SSH 进入机器配置
从 https://serverfault.com/questions/1053045/openwrt-how-to-redirect-all-subdomains-of-a-hostname-to-the-same-host-so-tha 看到只要安装 luci-mod-network 就可以在 Web 界面添加 Addresses 配置