If your mac (OSX Lion) is taking too long to get pages with your local web server and you have virtual hosts setup, then it’s probably because it is checking the DNS servers before it checks for it in your /etc/hosts.
The way to resolve this is to have a ::1 entry in your hosts file for every 127.0.0.1 entry. Here’s an example:
127.0.0.1 example.com
::1 example.com
You will notice I have 2 entries for example.com. One is IPv4 and the other is IPv6. My requests to the local web server take almost no time at after I did that. I think Lion tries to use IPv6 before it uses IPv4 and since it doesn’t find any entries for that in your hosts file, it goes to the internet searching for that domain.
Leave a Reply