i have used "sudo nano /etc/dhcpcd.conf" and added static address, after reboot the raspberry pi shows static address in ifconfig and i can also access it using putty, but it is not able to connect to the internet. i have checked the router and this device does not show up. I am sure there is nothing wrong with the router or cable as i was able to access internet before setting the static ip address.

ifconfig before setting static ipifconfig

lines i have typed..

"interfaces eth0
static ip_address=
static routers=
static domain_name_servers="
  • "no internet" is SUCH a vague expression. What's the output of traceroute -n and ping google.com May 19 '16 at 23:59
  • had the same problem. wrote 'domain_name_server' instead of 'domain_name_servers'. typo.
    – Gilad
    Oct 3 '17 at 19:29

You have not provided sufficient information to give a definitive answer. You should post what ifconfig shows BEFORE attempting to set static (or get this form another computer).

There is at least one obvious error; an incomplete CIDR address. See How do I set up networking/WiFi/Static IP

Address should be

static ip_address=

The comment about DNS is probably wrong. You may want to use Google's DNS, but you would be far better to use that provided by your ISP. In many cases what you had is correct as the router handles this.

To discover what DNS is in use run cat /etc/resolv.conf and note the nameserver

PS WHY do you want to set a static IP address?

  • i have added ifconfig info before setting static ip pls check May 19 '16 at 23:18
  • i am building a cluster of raspberry pi, have to use MPI, so setting a static ip will avoid lot of confusion May 20 '16 at 1:00
  • When do ISPs run dns servers on local IP addresses? I've never seen that happen in the consumer world before? May 20 '16 at 12:25
  • @MohammadAli They don't. You need to learn more about routers before offering advice to others. In general the router knows the DNS (from the ISP) and routes requests from clients.
    – Milliways
    May 20 '16 at 12:34
  • I've never really seen that happen too often, I guess it varies as to where on the world you are as ISPs where I live never offer free dns services, but I see what you mean May 20 '16 at 12:49

It is because you are using an incorrect dns please change the line below to reflect upon a valid dns service.

static domain_name_servers=

An example of a valid fans would be googles free public fans located at, so to use googles fans service you would change that line to the following:

static domain_name_servers=
  • i have edited the dhcpcd.conf to the dns you have specified May 19 '16 at 22:23
  • but no effect. i still did not get internet. i am sorry this is dumb but i dont know how dns works May 19 '16 at 22:24
  • What is your output when you ping a site such as Google. Com using the following command ping google.com May 20 '16 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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