My problem is similar to this question but the answer provided there is not helping me.

I am working on RPI4B and connected to WiFi with my Android device.

If I modify the etc/network/interfaces then my wifi connection also goes out. My interfaces file is blank as opposed to shown in the post I linked earlier.

  • 1
    Following a 3 year old link is a bad idea (the supported OS has changed 2 times). This one is one of the worst you could find - it is a self answered question and WRONG. See How to set up networking/WiFi to do it properly
    – Milliways
    Commented Feb 5, 2020 at 21:51
  • 1
    Does this answer your question? How do I set up networking/WiFi/static IP address?
    – Dougie
    Commented Feb 6, 2020 at 12:55
  • What device connects to the internet? Is it the android device? And it is enabled as hotspot to which the Raspi connects? If so, maybe the problem isn't the RasPi.
    – Ingo
    Commented Feb 6, 2020 at 17:40

2 Answers 2


Recover the /etc/network/interfaces by adding these lines:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

Then try to connect to your AP/Wireless router and check the internet connection out by ping www.google.com and if it says host unreachable ... or get you nothing, try to set static dns server:

sudo nano /etc/dhcpcd.conf

Comment/Remove all lines and add static domain_name_servers= and try pinging google.

  • Why do you keep telling people to use This is not a public DNS. To quote "Unless you are a Level-3 customer, absolutely not. Google now has established public DNS servers at which you should use." Actually better is to use the DNS on your ISP as supplied by your router.
    – Milliways
    Commented Feb 5, 2020 at 22:08
  • @M.Rostami it worked for some time and again no internet... Commented Feb 6, 2020 at 7:13
  • @WritingNewbie Ok, add a static IP address to the /etc/dhcpcd.conf by this link. Commented Feb 6, 2020 at 7:40

Raspberry Pi is made for education and to show newbies how hardware and software works. So the Raspberry Pi Foundation has taken any effort to make things as simple as possible to start with Raspberry Pi. Just follow its official documentation and most things will work out of the box.

Take a Raspberry Pi image of your choice and flash it to the SD Card. Against the recommodation on that side please don't use NOOBS! We always see many trouble with it here. When the virgin Raspbian operating system has booted up in your RasPi then you should already be able to connect it with an ethernet cable to your internet router out of the box. If you want WiFi then look at its Wireless connectivity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.