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

前端之家收集整理的这篇文章主要介绍了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

猜你在找的HTML相关文章