The work around that doesn’t need anyone changing their hosts file is to ask devs to modify their connection string for their DB managing software of preference to use the following string:

mongodb://localhost:27017/?replicaSet=local&directConnection=true

Really strange how the flag lets the db actually reply to the connection request as it was listening correctly on the given port. Anyway, much better than fiddling with the hosts file.