/etc/resolv.conf加上以下配置即可
[root@CentOS7 ~]# vi /etc/resolv.conf
# Generated by NetworkManager
search localdomain
nameserver 8.8.8.8
nameserver 8.8.4.4