Home  >  Q&A  >  body text

linux - centos执行curl命令无结果?

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

PHP中文网PHP中文网2744 days ago1323

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 17:06:13

    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

    reply
    0
  • PHPz

    PHPz2017-04-17 17:06:13

    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🎜

    reply
    0
  • Cancelreply