About cannot get host info reported in disconf ContOS
I found the problem of cannot get host info reported by deploying disconf in linux. I found it through the disconf source code on github:
Row 45th: InetAddress. getLocalHost (); it is found that this method is very difficult on linux.
InetAddress. getLocalHost returns an incorrect IP address. Why does this function return an incorrect address, because the principle of this function is to obtain the hostname of the local machine, and then parse the hostname to obtain the IP address. If the host name is directed to an incorrect IP address in the/etc/hosts file of the Local Machine, InetAddress. getLocalHost will return the wrong IP address. Of course, if your hostname is resolved by DNS, it may happen that the information on DNS is also wrong, and it is also a tragic ending.
Solution:
View host names using hostname
Modify/etc/hosts: add a line: [local IP address] [host name]
Done.