微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

domain-name-system – 不自动包含DNSMasq地址中的所有子域

可以配置DNSMasq,使其仅针对该确切域的请求返回固定IP地址,而不是针对其子域返回?也就是说,我希望它在解析example.com时返回固定的IP,但不是a.example.com,b.example.com等.

解决方法

host-record=example.com,1.2.3.4

dnsmasq man page说:

–host-record=<name>[,<name>….][<IPv4-address>],[<IPv6-address>]
Add A,AAAA and PTR records to the DNS. This adds one or more names to the
DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
appear in more than one host-record and therefore be assigned more
than one address. Only the first address creates a PTR record linking
the address to the name. This is the same rule as is used reading
hosts-files. host-record options are considered to be read before
host-files,so a name appearing there inhibits PTR-record creation if
it appears in hosts-file also. Unlike hosts-files,names are not
expanded,even when expand-hosts is in effect. Short and long names
may appear in the same host-record,eg.
–host-record=laptop,laptop.thekelleys.org,192.168.0.1,1234::100

原文地址:https://www.jb51.cc/html/229161.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐