How can I eliminate slow resolving/loading of localhost/virtualhost (a 2-3 second lag) on Mac OS X Lion?

前端 未结 13 866
梦毁少年i
梦毁少年i 2020-12-04 06:00

Since setting up my development environments on Mac OS X Lion (brand new macbook air purchased in January 2012), I have noticed that resolving to a virtual host is very slow

13条回答
  •  借酒劲吻你
    2020-12-04 06:24

    There's another issue 10.7.* to 10.8.4 for sites ending in .local which causes five second lookups. Details and solution courtesy Bram Van Damme’s blog post found here.

    “By default, any hostname ending in .local is treated as a Bonjour host rather than by querying the DNS server entries in Network preferences.”

    “To fix this problem (without having to rename each vhost) you need to add IPv6 entries for each of your vhosts in your /etc/hosts file:”

    ::1 mysite.local
    fe80::1%lo0 mysite.local
    127.0.0.1 mysite.local
    

提交回复
热议问题