In CentOS 7 you will often find /etc/resolv.conf overwritten after each reboot or network service restart. It’s done the NetworkManager. If you check your resolv.conf after reboot you will see that your changes are gone and it will look something like this
[root@cpanel ~]# cat /etc/resolv.conf search domain.tld # Generated by NetworkManager nameserver 126.96.36.199 [root@cpanel ~]#
This happens because of the DNS entries present in the network interface files. Check for DNS1 and DNS2 entries in the network config files and and remove them.
[root@cpanel ~]# cd /etc/sysconfig/network-scripts [root@cpanel network-scripts]# grep DNS ifcfg-* ifcfg-ens160:PEERDNS=yes ifcfg-ens160:IPV6_PEERDNS=yes ifcfg-ens160:DNS1=188.8.131.52 [root@cpanel network-scripts]#
I above example removing the “DNS1=184.108.40.206” entry from the ifcfg-ens160 file will solve the problem.