What happens if the Linux address is not ping?

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.