(这个问题在 10.7.1 更新中消失了 - /etc/hosts 现在对我来说一如既往地工作)
我已经将我的 Mac 更新为 Lion,现在我注意到 /etc/hosts 是最后查询的,即使在 DNS 之后也是如此。这很烦人,因为我有很多用于开发的主机名。
名称解析顺序在哪里配置?我可以使用 dscacheutil 检查它,所以这是雪豹机器告诉我的:
pilif@tali ~ % dscacheutil -configuration
DirectoryService Cache search policy:
/Local/Default
/BSD/local
Settings:
AAAA Queries - Disabled (link-local IPv6 addresses)
Default TTL - 3600
Policy Flags - 0
Run Code Online (Sandbox Code Playgroud)
这是狮子告诉我的
pilif@kosmos ~ % dscacheutil -configuration
DirectoryService Cache search policy:
/Local/Default
Unable to get details from the cache node
Unable to get cache configuration information
Run Code Online (Sandbox Code Playgroud)
除了这两个错误之外,我认为 /BSD/Local 是让它更早读取 /etc/hosts 的原因。
有没有人知道这个“缓存搜索策略”的存储位置以及如何将其更改回来?
我知道我可以使用 dcsl 创建主机名条目,但我真的很想保留我在各种机器上使用的 /etc/hosts。
更新:解析顺序显然可以在目录实用程序中配置。不幸的是,此安装 …