title: Connect to remote PostgreSQL database using hostname instead of ip address
body: <p>when constructing my connection string in my vb.net program, I can connect to a PostgreSQL database on another computer if I use an ip address of that server. However, is there a way to use the hostname of the server instead of the ip address?</p>
  
  <p>I am using npgsql in vb.net, and my connection string is:</p>
  
  <pre><code>Server=127.0.0.1;Port=5432;Database=myDataBase;User Id=myUsername;Password=myPassword;
  </code></pre>
  
  <p>Can I do something like:</p>
  
  <pre><code>Server=server-name;Port=5432;Database=myDataBase;User Id=myUsername;Password=myPassword;
  </code></pre>
  
  <p>PostgreSQL documentation says I can use the address/name of the server but that doesn't seem to connect (No such host is known).</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Here is the link for the documentation I found. It is npgsql's documentation though, not postgreSQL like I thought.
  <a href="http://npgsql.projects.pgfoundry.org/docs/manual/UserManual.html" rel="nofollow">http://npgsql.projects.pgfoundry.org/docs/manual/UserManual.html</a></p>
  
  <p>it says this under the Connection String parameters section: Server - Address/Name of PostgreSQL Server</p>