For this PostgreSQL configuration example:


    local   replication   repmgr                              trust
    host    replication   repmgr            trust
    host    replication   repmgr          trust

    local   repmgr        repmgr                              trust
    host    repmgr        repmgr            trust
    host    repmgr        repmgr          trust

I have two questions.

Question 1

This is how a netmask looks for IPv4:

How to do with an IPv6 IP address like 230b:c010:103:5858:a6a3:3:0:1?

Question 2

If use JDBC to connect to a PostgreSQL server, I can use a connection URL containing How to do it with IPv6? Is it like 230b:c010:103:5858:a6a3:3:0:1:5432?

1 Answer 1


Answer 1:

Like the documentation says:

An IPv6 address range might look like ::1/128 for a single host (in this case the IPv6 loopback address) or fe80::7a31:c1ff:0000:0000/96 for a small network. represents all IPv4 addresses, and ::0/0 represents all IPv6 addresses. To specify a single host, use a mask length of 32 for IPv4 or 128 for IPv6. In a network address, do not omit trailing zeroes.

Answer 2:

Like the documentation says:

  • host

The host name of the server. Defaults to localhost. To specify an IPv6 address your must enclose the host parameter with square brackets, for example:

  • Very good answer! Thank you!
    – rawmain
    Commented Dec 18, 2019 at 8:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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