Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a local network and want to allow remote access to the postgres server in the another computer.

The PostgreSQL suggests the following pg_hba.conf entry but it doesn't work:

host all all md5

I get the following error:

FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", 
SSL on FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off

It only works if I specify the IP address and mask like below:

host all all md5

The server machine runs Ubuntu 10.11/Postgre 9 and client machine runs Windows 7 x64

Someone knows how can i allow all my network to access the server?

share|improve this question

migrated from Dec 16 '11 at 3:01

This question came from our site for professional and enthusiast programmers.

Older versions of PostgreSQL didn't understand the CIDR "x.x.x.x/n" format, they required long-format netmasks. If you specify the netmask the long way like you did in the second line it should work. If it doesn't, please make sure you restarted PostgreSQL after making the change and please specify your PostgreSQL version. – Craig Ringer Dec 14 '11 at 5:17
If your version of PostgreSQL supports CIDR addressing, wouldn't yours be 24 bits is the first three octets, isn't it? – Mike Sherrill 'Cat Recall' Dec 14 '11 at 6:16
I think this should be migrated to – a_horse_with_no_name Dec 14 '11 at 8:00
up vote 2 down vote accepted

You have bad netmask. If you want to add host to network, you have to use netmask even /16 or

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.