In my Ubuntu 17.04 machine ping google.com did not work. So I opened /etc/resolv.conf file and its content was :
nameserver 192.168.1.1
nameserver 127.0.0.53
I added nameserver 8.8.8.8 to the above file but it gets overwritten on restart of network service.
So as mentioned in the other answers I added nameserver 8.8.8.8 to /etc/resolvconf/resolv.conf.d/base file and restarted network service. Now the nameserver value appears in /etc/resolv.conf file but ping google.com or apt-get update does not work.
Any help regarding this is much appreciated.
I solved the above problem by referring this : https://askubuntu.com/a/973025
returned this
I wanted to change this. So after reading above answer, I edited /etc/systemd/resolved.conf
and restarted the service -
Now systemd-resolve --status returned this