The current implementation of [webservice] hostname is confusing and difficult to work with. It's not uncommon on a Linux server to have the following in the /etc/hosts file so that the machine resolves it's own name. This is not connected to mailman at all, it could just be general practice.
/etc/hosts:
127.0.1.1 mailman.example.com mailman
However, if you have that in place, and then this mailman config file. /etc/mailman/mailman.cfg
[webservice] hostname: mailman.example.com port: 8001
mailman-core will only listen on localhost. Maybe you don't want that. It shouldn't be necessary to play games with /etc/hosts because the problem could be resolved this way:
[webservice] hostname: mailman.example.com bind_to: 0.0.0.0 port: 8001
or
[webservice] hostname: mailman.example.com listen: 0.0.0.0 port: 8001
Then any outgoing api messages or other communications would reference the so-called hostname, which remote clients would use, "mailman.example.com" .
If the "listen" or "bind_to" field is absent, fall-back to the current behavior.