ping: http://google.com: Name or service not known

change the VirtualBOx network card

use -> Intel PRO/1000 T Server (82543GC)


ping has nothing to do with HTTP or HTTPS:

Ping will use ICMP protocol, it belongs to TCP/IP

Ping operates by sending Internet Control Message Protocol (ICMP) echo request packets to the target host and waiting for an ICMP response.

Actually ping works at a much lower level than HTTP or HTTPS, and only accepts hostnames, not URLs.


First make sure you have your network adapter enabled in virtual box settings.

Your network interface which you use it for connecting to internet might not be active.

  1. To check this,use "sudo nmcli d" command.

  2. If it is disconnected,use "sudo nmtui"->Edit a connection,select your network interface and choose "Automatically connect" option(by pressing Space key) and select OK.

  3. Do "sudo reboot now" After logging in,do "ping www.google.com".

You should be able to connect now.

Tags:

Centos7