Trying to connect my new Raspi to the internet for the first time via a cross-over to a bridged connection with my laptop's wi-fi.

The Raspi browser works for internal network webservers but won't receive anything from the WAN using either URL or ip address. Get a name resolution failure and a fail to load page.

I'm thinking it must be router related as it only fails if going through the gateway router.

Any ideas what the issue might be and how to resolve it?

  • What's the output of the following commands? ip addr show ip route show cat /etc/resolv.conf I think your dhcp server has either not send the correct dns servers or routers to external networks. Did you try pinging a external server? ping -c 4 (This is a DNS Server from google).
    – teissler
    Jan 3, 2013 at 7:13
  • 1
    Try running traceroute Since external ping fails, we're interested in first few results.
    – AndrejaKo
    Jan 3, 2013 at 9:08
  • Problem is resolved. I rebooted the laptop this morning and the router. Re-instated the bridge in the laptop and suddenly things started to work. Jan 3, 2013 at 18:51

2 Answers 2


Try the following:

sudo nano /etc/network/interfaces

Then on the interfaces file you should have something like:

iface wlan0

Insert a new line exactly after that one with your DNS server (I will use google's for the example):


Exactly like that and just reboot your pi via:

sudo reboot

That fixed mine, I hope it gets yours going!


I also changed the content of the file resolv.conf on the /etc/ directory:

sudo nano /etc/resolv.conf

In which you will see something like:

domain gateway.2wire.net
search gateway.2wire.net

Change the nameserver IP to whatever your DNS is.

  • 1
    this solution solve my problem after several hours crashing my head with it
    – rdiaz82
    Mar 30, 2016 at 23:08
  • 1
    This solution is specifically for if you're not using dhcpcd
    – Blake
    Nov 1, 2020 at 10:54
  1. I modified a file using the command below:

    sudo nano /etc/dhcpcd.conf
  2. uncommented this line:

    static domain_name_servers= blah blah

    it is in the third block from the bottom, seems to have worked

  • Can you please show the code that worked?
    – SDsolar
    Jun 28, 2018 at 22:41

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.