title: Why my postgresql do not find my host
body: <p>My server is Debian 7 and I use PostgreSQL 9.3.</p>
  
  <p>This is my hosts file：</p>
  
  <pre><code>root@localhost:/etc# cat hosts
  127.0.0.1       localhost.localdomian  localhost
  127.0.1.1       virtualserver.com       virtualserver
  
  # The following lines are desirable for IPv6 capable hosts
  ::1     localhost ip6-localhost ip6-loopback
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters
  </code></pre>
  
  <p>And when I want to startup a new console of <strong>psql</strong>:</p>
  
  <pre><code>root@localhost:/var/lib/postgresql/9.3/main# service postgresql restart
  [ ok ] Restarting PostgreSQL 9.3 database server: main.
  root@localhost:/var/lib/postgresql/9.3/main# sudo -u postgres psql
  sudo: unable to resolve host localhost.localdomain
  psql (9.3.0)
  Type "help" for help.
  </code></pre>
  
  <p>You can see that the the machine can not find the <code>localhsot.localdomain</code>. But I changed the root files, and make it as correct in my <code>/etc/hosts</code> files and reboot it already.</p>