Curl cannot resolve host solution

Source: Internet
Author: User
The usage of the host cannot be resolved using curl: & nbsp; 1. two local networks can be connected to the Internet. Use HTTP to obtain data from the remote server. & Nbsp; 2. any CURL can work normally. & Nbsp; problem: & nbsp; When a network is connected to work normally, unplug the network cable and change to another network. when the device is not closed and request data from the server, the system prompts that the master curl cannot be resolved and the host cannot be resolved.
Usage:
1. two local networks can be connected to the Internet. Use HTTP to obtain data from the remote server.
2. any CURL can work properly.

Problem:
After a network connection works properly, unplug the network cable and change it to another network. when the device is disabled and request data from the server, the system prompts that the host cannot be parsed.
However, if the network cable is inserted back at this time, CURL can resolve the host properly and work properly.


So I want to check whether it is a CURL. after The DNS is cached and the network cable is changed, the previous data is used.

However, my code uses curl_easy_cleanup, curl_global_cleanup,
Crul_easy_setopt (curl, CURLOPT_FRESH_CONNECT, 1) is added)
Curl_easy_setopt (curl, CURLOPT_FORBID_REUSE, 1)
Curl_easy_setopt (curl, CURLOPT_DNS_USE_GLOBAL_CACHE, 0)

These are useless. Who knows what to do?


------ Solution --------------------
This problem may be caused by many problems.
1. what do two local networks mean? Gateway issues different accesses to the Internet
2. the firewall may affect everything.
3. idenfy and session may be different.
------ Solution --------------------
The most comprehensive Chinese manual for the CURL function library in PHP
Http://hi.baidu.com/382262106/blog/item/a68694012db59f017aec2c6d.html
------ Solution --------------------
Discussion
The most comprehensive Chinese manual for the CURL function library in PHP
Http://hi.baidu.com/382262106/blog/item/a68694012db59f017aec2c6d.html

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.