Can't connect to www.google.com even being connected to the Internet.
I always need to change the DNS to
/etc/resolv.conf but it changes automatically into
127.0.0.1 and then www.google.com do not work.
/etc/network/interfaces file and add the following to the end:
/etc/resolv.conf since that file is generated automatically.
I had the problem that my raspberry 3 couldn't connect to inet, but it had connection (no ping to google.com but it had ping to the ip address). So I figured it was a DNS problem. After a search I found this solution. Sorry, but I don't remember where, so I can't post the link.
It's true that /etc/resolv.conf is created at every reboot, so you lose the changes you make.
A solution is to create a file in /etc named resolv.conf.head
sudo nano resolv.conf.head
and the put there the lines with the dns servers you want. For example, for google and OpenDns:
#Google DNS nameserver 188.8.131.52 #OpenDns Servers nameserver 184.108.40.206 nameserver 220.127.116.11
The lines you write in this file are automatically added to resolv.conf when it is generated.