I have a mongodb replicaset on ubuntu.. In replica set, hosts are defined as localhost. You can see ;
{ \"_id\" : \"myrep\", \"version\" : 4, \"membe
The only way I found to change host names is recreating replica set.. To make it right db directories need to be cleaned.. Then starting all servers with replication mode after that creating new repset with new host names fixed it.