There are several ways Centos7 DNS configuration:
- method one:
- First determine whether the identity of the root user login, if not, the best trade-in as the root user
- Input vi / etc / sysconfig / network-scripts / ifcfg-ens33
PS: DNS1 and gateway address as
3. Restart the network: service network restart
- Method Two
- vi /etc/sysconfig/network-scripts/ifcfg-ens33
- 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
- /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 - Disable NetworkManager: service NetworkManager stop