I have a fairly common problem - my centos 7 machines are using network-manager and the DNS in /etc/resolv.conf is managed by it, so changes are lost every time
the method describes a procedure which is missing a component
- perform the procedure linked above.
Basically add an entry "dns=none" to the file "/etc/NetworkManager/NetworkManager.conf"
- Reboot your computer. This will make the new setting kick in.
This is the step that is missing in the linked procudeure
- now edit your /etc/resolv.conf by adding "nameserver <ip address>
Example: nameserver 126.96.36.199
- This setting will remain after each reboot