Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Earlier today I was ssh'ing into my box and discovered that the internal IP had changed from what it was, I decided I wanted to make this static and found a tutorial (kind of) how to:

nano /etc/network/interfaces

And then changed the contents to this:

auto lo eth0
iface lo inet loopback
iface eth0 inet static

(I wanted my IP to be static at this). Now whenever I try to update, or install "git" using:

sudo apt-get update

I keep getting the error like so:

Err wheezy InRelease                                   

Err wheezy InRelease                               

Err wheezy Release.gpg                                 
Temporary failure resolving ''
Err wheezy Release.gpg                             
Temporary failure resolving ''
Reading package lists... Done                 
W: Failed to fetch  
W: Failed to fetch  

W: Failed to fetch  Temporary 
failure resolving ''

W: Failed to fetch  
Temporary failure resolving ''

I am connected to the internet, and this only seems to be happening since I updated the particular file.

Hope someone can help


Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface         UG        0 0          0 eth0   U         0 0          0 eth0

eth0      Link encap:Ethernet  HWaddr b8:27:eb:87:59:47  
          inet addr:  Bcast:  Mask:
          RX packets:4707 errors:0 dropped:50 overruns:0 frame:0
          TX packets:3488 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:334663 (326.8 KiB)  TX bytes:390376 (381.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:708 errors:0 dropped:0 overruns:0 frame:0
          TX packets:708 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:67655 (66.0 KiB)  TX bytes:67655 (66.0 KiB)
share|improve this question
Can you post output of netstat -rn and ifconfig -a? –  Karlson Jan 18 '13 at 18:57
@Karlson Thank you for the reply. I have updated my o/p to what you asked for –  Phorce Jan 18 '13 at 19:01
You'd be better off just configuring your router to always allocate the same IP to this machine. –  ire_and_curses Jan 18 '13 at 19:02

1 Answer 1

Assuming that your IP and gateway are properly configured, your DNS nameservers are not. They can be configured in /etc/resolv.conf, in the following format:


Another option is to install the resolvconf package and add the following to /etc/network/interfaces.


Then restart the interface for the changes to take affect:

ifdown eth0
ifup eth0
share|improve this answer
Thanks :) In /etc/resolv.conf I have "nameserver" repeated, so shall I replace these with: nameserver –  Phorce Jan 18 '13 at 19:05
@phorce that's not the problem if is a valid nameserver. Can you ping it? You can definitely try, which is google's resolver. –  jordanm Jan 18 '13 at 19:06
I can ping it, yes. Is there any way that I could go back to how it was before? I.e. replace the lines in "/etc/network/interfaces" and then have my router static the IP for this device? Thanks –  Phorce Jan 18 '13 at 19:09
Are you sure that is a DNS server? When I did lookup for NS records for this IP I got 4 completely different servers. –  Karlson Jan 18 '13 at 21:22
the address you wrote as DNS is probably mean to be instead. It's a private subnet (192.168.4.x) and .100 can be your local router / DNS (as is in some ADSL gateways-router setup). If it's the case, check your router IP. –  DavAlPi May 20 '13 at 13:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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