Mac OSX Lion DNS 查找顺序 [英] Mac OSX Lion DNS lookup order
问题描述
升级到 Mac OSX Lion 后,我发现/etc/hosts 不再是名称解析的首要任务.这会导致一些副作用,例如:
After upgrading to Mac OSX Lion I figured out that /etc/hosts is not looked up in first place for name resolution anymore. This leads to some side effects like:
- /etc/hosts 中的条目解析非常缓慢
- 您不能不覆盖现有域,例如127.0.0.1 www.google.com
- 如果您从 DHCP 获得搜索域条目,比如说 .lan,并且一些有趣的人将 localhost.lan 配置为其他内容,然后在本地 DNS 中设置为 127.0.0.1,您将无法再访问您的本地主机.
这是有意为之吗?它有任何意义吗?最重要的是,我怎样才能回到旧的行为.
Is this behavior intended? Does it make any sense? And most important, how can I come back to the old behavior.
推荐答案
我认为重要的是 Lion 处理 .local TLD 的方式不同,因为它保留用于某些多播 DNS 功能(由 Bonjour 使用).我发现解决此问题的唯一方法是为开发主机使用不同的 TLD(即:.dev).对我来说效果很好,希望对其他人有帮助!
I think he matter is Lion handles .local TLD differently because it's reserved for some Multicast DNS features (used by Bonjour). The only way i found to solve this issue is using a different TLD for development hosts (ie: .dev). It works fine for me, hope it's gonna be helpful to others!
这篇关于Mac OSX Lion DNS 查找顺序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!