title: Cannot resolve localhost: Unknown host on OS X 10.8.2, but 127.0.0.1 is working fine
body: <p>I have MAMP installed on my Macbook Pro (OS X 10.8.2). Both Apache Server and MySql server are in green lights in MAMP. But I could NOT access localhost; I'm able to reach 127.0.0.1. (both localhost and 127.0.0.1 were working fine before.)</p>
  
  <pre><code>leihetekiMacBook-Pro:~ leihe$ ping localhost
  ping: cannot resolve localhost: Unknown host
  </code></pre>
  
  <p>When I tried to access localhost in safari, it shows:</p>
  
  <pre><code>Safari can't open the page "http://localhost/" because Safari can't fine the server "localhost". 
  </code></pre>
  
  <p>In apache_error.log, it shows:</p>
  
  <pre><code>[Tue Feb 18 14:30:43 2014] [error] [client 127.0.0.1] client denied by server     configuration: /Users/leihe/Desktop/Sites/.DS_Store
  </code></pre>
  
  <p>My hosts file is located in private/etc and looks like this:</p>
  
  <pre><code># Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  127.0.0.1       localhost
  255.255.255.255 broadcasthost
  ::1             localhost
  fe80::1%lo0     localhost
  </code></pre>
  
  <p>I also tried flushing DNS sever.</p>
  
  <p>Any solutions would be much appreciated!!</p>