Centos7 ping unknown name or service DNS configuration issues

There are several ways Centos7 DNS configuration:

  • method one:
  1. First determine whether the identity of the root user login, if not, the best trade-in as the root user
  2. Input vi / etc / sysconfig / network-scripts / ifcfg-ens33

               

            PS: DNS1 and gateway address as

        3. Restart the network: service network restart

  • Method Two
  1. vi /etc/sysconfig/network-scripts/ifcfg-ens33
  2. In the bottom add:

             DNS1 = 8.8.8.8 #google dns server, to replace the actual situation
             DNS2 = 8.8.4.4 #google dns server, to replace the actual situation

         3. Restart Internet: service ntwork restart

  • Method Three
  1. /Etc/resolv.conf modify, add
    nameserver 8.8.8.8 #google dns server, to replace the actual situation
    nameserver 8.8.4.4 #google dns server, to replace the actual situation
  2. Disable NetworkManager: service NetworkManager stop

 

Guess you like

Origin www.cnblogs.com/huainanhai/p/11111208.html