"If it resolves to 127.0.0.1"

If a hostname with an FQDN resolves to localhost IP, then there is probably a misconfiguration on the system, and other things will likely go wrong.

We could force name resolution by setting a property `sun.net.spi.nameservice.provider.1` to `dns,sun`, to get around mistakes in `/etc/hosts`, but still it seems out of scope.

That assumes there is an FQDN set along with the hostname.  I'm curious to know about other cases you found.