linux bind,如何配置能够解析不带域名的host主机名。

linux bind,如何配置能够解析不带域名的host主机名。,第1张

从你提供的系统看你的bind应该是可以支持Response Policy Zone (RPZ) Rewriting策略的。

把主机名都写在rpz的zone里应该是可以实现的。

例如

response-policy { zone "badlist"}

and this zone statement

zone "badlist" {type masterfile "master/badlist"allow-query {none}}

with this zone file

$TTL 1H

@ SOA LOCALHOST. named-mgr.example.com (1 1h 15m 30d 2h)

NS LOCALHOST.

QNAME policy records. There are no periods (.) after the owner names.

server1 A 10.0.0.1

在hosts文件中,添加IP和域名的对应关系

windows下文件位于C:\windows\system32\drivers\etc\hosts

mac、linux下文件位于/etc/hosts

文件格式:

IP地址 host名称

例子:

127.0.0.1 example.com


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11723369.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存