InetAddress.getLocalHost() slow to run (30+ seconds)

The issue can be solved by adding the following to /etc/hosts (assuming output of hostname command is my-macbook:

127.0.0.1   my-macbook
::1         my-macbook

This returns the time to something more suitable (< 1 second)

Leave a Comment

tech