What happens if the Linux address is not ping?
Problem: Today wrote a paid project, there is a class in the use of the HttpPost request, the address of the HTTP request is: Https://api.mch.weixin.qq.com/pay/unifiedorder
Found in the normal use of the machine, in the Linux server log is returned java.net.UnknownHostException: api.mch.weixin.qq.com
The first thought is whether the server can normally access the external network, and then use the ping command to test, sure enough, is not used.
The way I fix it is to modify the Hosts file, the path /etc/hosts
of the file
First step: Get the IP address of the requesting address domain name on this computer
or use webmaster tools to get the IP address http://ip.chinaz.com/?IP=api.mch.weixin.qq.com, different IP addresses differ
Step Two: Modify the server Host file
Add the IP address and domain name to the host file.
After the save, the ping command is available.
Then my project will also be able to access the network.
What happens if the Linux address is not ping?