openwrt 实现范域名解释的方法
openwrt 实现范域名解释的方法
有很多服务部署在内网,绑定了域名
要在路由一个个域名添加很麻烦,直接一把范域名解释梭哈
/etc/dnsmasq.conf
####add sub.home.domain.com#########
address=/.home.domain.com/172.16.18.18
########################
/etc/init.d/dnsmasq restart
现在在内网任意客户端访问上面的范域名都会返回172.16.18.18
也可以使用ping 或者dig测试
nslookup test.home.domain.com 指向的IP
nslookup test.home.domain.com
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: test.home.domain.com
Address: 172.16.18.18搞定,记得要在服务器上绑定域名