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.
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
/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 22.214.171.124 #OpenDns Servers nameserver 126.96.36.199 nameserver 188.8.131.52
The lines you write in this file are automatically added to resolv.conf when it is generated.