CentOS ping www.google.com Error: name or service not know

When the installed operating system Ping www.google.com, report name or service not known

It’s OK to check the virtual network settings. Some virtual machines from the same template can or can’t Ping the Internet

Finally, several data are integrated, and the solutions are as follows:

1 add DNS server first

vi /etc/resolv.conf

Add the following two lines to the file:



Save, exit and restart the server. Then Ping again and try again

If not, continue:

2 set a file:

VI/etc/sysconfig/network scprits/ifcfg-ens33 (the file name may be different. Mine is ens33, and some seem to be ENS plus other numbers)

Find onboot = no in the file and change to onboot = yes

Save exit

Restart network: systemctl restart network


Similar Posts: