Only binding to either IPv4 or IPv6, not both?

71 views
Skip to first unread message

Eddie Jibson

unread,
Feb 7, 2018, 1:35:25 PM2/7/18
to mongodb-user
Hi,

So my initial problem was when I had specified within mongod.conf to listen on both an IPv4 and IPv6 address- it spit out an error "getaddrinfo failed: Address family for hostname not supported". So after searching around, apparently you should set "ipv6: true" within the net property for it to function properly. However, now MongoDB only listens on the IPv6 address.

Here's a current snippet of my config file:
net:
  ipv6: true
  port: 27017
  bindIp: 127.0.0.1,ipv4Address,ipv6Address 

There seems to be no error in the log file...

This is the most recent version of MongoDB.

Any ideas?

Thanks.

Wan Bachtiar

unread,
Mar 28, 2018, 8:12:18 PM3/28/18
to mongodb-user

Any ideas?

Hi Eddie,

It’s been a while since you posted this question, have you found a solution yet ?

You should be able to bind to both IPv4 and IPv6 addresses (net.bindIp), after also enabling net.ipv6 option.

Ensure that the values are the server’s own IP addresss and/or full Unix domain socket path.

This is the most recent version of MongoDB

What’s the specific version ?

However, now MongoDB only listens on the IPv6 address.

How did you do this test/check ?

If you still have further question, could you provide the first 30 lines of the mongod startup log file ?
It should contains the label [initandlisten]

Regards,
Wan.

Reply all
Reply to author
Forward
0 new messages