Multiple IPs are not getting bind in mongodb conf file I am trying to bind multiple IP to mongodb config file, one is 0.0.0.0 and other is 127.0.0.1. I did the following change in configuration file


  /etc/mongod.conf


# network interfaces
net:
  port: 27017
  bindIp: "0.0.0.0,127.0.0.1"


Than I reloaded the configuration by the following command

sudo mongod --config /etc/mongod.conf


Than checked if the server is listening on localhost as well or not by the following command.

netstat -tlpn


It shows the output only for 0.0.0.0

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:27017           0.0.0.0:*               LISTEN      -


Why is it not listening to localhost as well?
had the same issue and the thing is everywhere it's written that you have to bind them like this

bindIp : 127.0.0.1,192.168.0.50

but that doesn't work.

The MongoDB version 3.2.x have the following configuration and its working for me.

    bindIp : [127.0.0.1,192.168.0.50]

    example :

# network interfaces
net:
      port: 27017
      bindIp : [127.0.0.1,10.12.2.1,10.12.65.1]