当用户查询不存在的域名(如http://www.not-exist-website.com/)时,是否可以使用dnsmasq解析为本端IP?
另一种情况是dnsmasq无法解析请求域名(例如中国的http://www.google.com/ ),是否可以使用dnsmasq将其解析为本端IP?
PS:
我不知道在实现上是否与上述情况有所不同。
我正在开发OpenWRT路由器,使用dnsmasq作为本地DNS服务器。
本端IP运行nginx服务器,托管本地主页。
发布于 2017-01-19 18:29:44
添加到/etc/hosts
192.168.0.10 www.nonexistentdomain.com www将以下内容添加到/etc/dnsmasq.conf
server=8.8.8.8
server=8.8.4.4
domain=nonexistentdomain.com通过添加以下行,可以使dnsmasq对给定域具有权威性
domain=existingdomain.com请注意,上述域的dns解析仅限于本地条目。
可以将现有域的条目添加到/etc/hosts中
192.168.1.10 www.existingdomain.comhttps://stackoverflow.com/questions/41739211
复制相似问题