linux - centos执行curl命令无结果?
PHP中文网
PHP中文网 2017-04-17 17:04:13
0
2
1321

centos7服务器执行curl命令,一直是下面的状态,是哪里配置有问题吗?

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
Ty80

Dear, try pinging www.baidu.com first to see if you can resolve the Baidu address? I guess you haven’t configured the DNS address

PHPzhong

Ping www.baidu.com first
Check whether the network is normal. If you can ping successfully, it is recommended that you check whether a proxy is set up. Ping does not use a proxy. echo $http_proxy Look at the output. If there is output, it proves that the proxy is configured.
Enter ifconfig
Check if the IP settings are correct
Then you may need to configure dns and gateway
This is the configuration command:

For example, modify the IP of the network card eth0 to 192.168.1.111
ifconfig eth0 192.168.1.111 netmask 255.255.255.0ifconfig eth0 192.168.1.111 netmask 255.255.255.0
修改网关为192.168.1.1
route add default gw 192.168.1.1
Linux命令行修改dns
echo "nameserver 114.114.114.114">> /etc/resolv.conf
重启网络服务
/etc/rc.d/init.d/network restrartModify the gateway to 192.168.1.1

route add default gw 192.168.1.1 🎜Linux command line to modify dns🎜echo "nameserver 114.114.114.114">> /etc/resolv.conf🎜Restart the network service🎜/etc/rc.d/init.d/ network restrart🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!