Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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'm having a problem with configuring my postgresql server. I've installed PostgreSQL 9.0.2 on slackware 13.1x64 and it runs fine but I can't add a IP that could connect to PostgreSQL remotely.

The logs show me this:

LOG:  invalid IP mask "trust": Name or service not known
CONTEXT:  line 83 of configuration file "/usr/local/pgsql-9.0.2/data/pg_hba.conf"
FATAL:  could not load pg_hba.conf

And on that line I have:

host    all         all         **.**.***.*         trust

The ** is my real IP address. But PostgreSQL tells me I need to set ip mask ? What's that I'm doing wrong ?

Thanks in advance,

share|improve this question
up vote 13 down vote accepted

You need to specify an IP address of the form: where "/24" is an alternative representation of your Subnet-Mask.

For a local area network you often see as a Subnet-Mask. Each part of that Mask can be translated to an 8-Bit representation (255 = 11111111). So for 3 x 255 you've got 3x 8-Bit which leads to a total of 24-Bits and there you go. Of course, you'll find more detailed explanations on the internet.

Just use or ask your provider for your Subnet-Mask.

share|improve this answer
I know that. But I'm using a real IP - internet IP address not a local... :) – tftd Jan 20 '11 at 13:15
pg_hba.conf wants an IP mask, not an IP address. Try or whatever your IP address is. – Alex Holst Jan 20 '11 at 13:18
Thanks. That solved my problem! :) – tftd Jan 20 '11 at 13:25
@AlexHolst Thanks, I wonder why that wouldn't accept both form (i.e., CIDR and plain IP). – Franck Dernoncourt Feb 29 at 23:51

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.