java getLocalHost() UnknownHostException /etc/hosts file differs linux api?

前端 未结 1 925
心在旅途
心在旅途 2020-12-21 14:42

I have two redhat 6.3 machines, BOTH have no changes in /etc/hosts (ie. I have not added an ip address to them). On of my machines can run getLocalhost fine AND return the

相关标签:
1条回答
  • 2020-12-21 15:35

    ah, I stumbled upon the difference. In my /etc/sysconfig/network file, I had the FQDN on the working machine but on the other machine, I only had the hostname "b" so changing that to "b.domain.com" fixed the issue and I don't need to modify my /etc/hosts file at all!!!!

    Dean

    0 讨论(0)
提交回复
热议问题