vim /etc/resolv.conf
改為nameserver 8.8.8.8
nameserver 110.75.186.248
使用curl時,有兩個超時時間:一個是連接超時時間,另一個是數(shù)據(jù)傳輸?shù)淖畲笤试S時間。
連接超時時間用 --connect-timeout 參數(shù)來指定,數(shù)據(jù)傳輸?shù)淖畲笤试S時間用 -m 參數(shù)來指定。
例如:
curl --connect-timeout 10 -m 20 "http://XXXXXXX"
連接超時的話,出錯提示形如:
curl: (28) connect() timed out!
數(shù)據(jù)傳輸?shù)淖畲笤试S時間超時的話,出錯提示形如:
curl: (28) Operation timed out after 2000 milliseconds with 0 bytes received