If you are using a dedicated server or Virtual Private Server (VPS), you might stumbled across a problem where
resolv.conf keep resetting even after you changed them. This can cause some problems and one of them is, you cannot reach the outer world.
Some of them keep resetting to a useless dns nameserver that won’t resolve some domains, and very few of them even reset to 127.0.0.1.
The solution is quite simple. You need to install a package named
$ sudo apt install resolvconf
Then delete whatever you not needed in
/etc/resolvconf/resolv.conf.d/head and insert nameservers that you want to use. For example
nameserver 22.214.171.124 nameserver 126.96.36.199
It should look like this
$ sudo systemctl restart resolvconf
$ cat /etc/resolv.conf
and it should display the nameserver you inserted just now.