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

前端 未结 13 895
梦毁少年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:33

    A dumb issue that led me to waste some considerable time: after applying @Cleverlemming's answer, I figured out that there were duplicated entries on the hosts file. Something like:

    ::1          site1.local site2.local site1.local site3.local site4.local
    fe80::1%lo0  site1.local site2.local site1.local site3.local site4.local
    127.0.0.1    site1.local site2.local site1.local site3.local site4.local
    

    Then IP resolving for site3.local and site4.local takes these 5-seconds of death.

提交回复
热议问题