[java] java.net.UnknownHostException: Invalid hostname for server: local

Please try to set SPARK_LOCAL_IP environment variable to the ip address(can be localhost i.e. your own ip address) you want to connect. E.g.

$ export SPARK_LOCAL_IP=182.95.208.152

This way you will not be required to alter existing linux settings. Worked for me, hope helps you too.