0

I've read many askubuntu and other forum posts about loss of Internet connection. I've installed Debian 8.2 Jessy on a laptop, and used static IPv4 config:

  • IP Addr. 10.0.0.5
  • Mask 255.255.255.0
  • Gateway 10.0.0.138
  • Dns 8.8.8.8 (Google's DNS) + ISP's DNS It worked. Then, after some work on it, from nowhere the connection is lost. I've tried pinging the router:
 root@debian82:/home/user# ping 10.0.0.138
 PING 10.0.0.138 (10.0.0.138) 56(84) bytes of data.
 64 bytes from 10.0.0.138: icmp_seq=1 ttl=255 time=1.37 ms
 64 bytes from 10.0.0.138: icmp_seq=2 ttl=255 time=1.60 ms
 64 bytes from 10.0.0.138: icmp_seq=3 ttl=255 time=0.740 ms
 64 bytes from 10.0.0.138: icmp_seq=4 ttl=255 time=0.734 ms
 64 bytes from 10.0.0.138: icmp_seq=5 ttl=255 time=0.668 ms
 64 bytes from 10.0.0.138: icmp_seq=6 ttl=255 time=0.707 ms
 ^C
 --- 10.0.0.138 ping statistics ---
 6 packets transmitted, 6 received, 0% packet loss, time 5003ms
 rtt min/avg/max/mdev = 0.668/0.971/1.601/0.372 ms

I've tried pinging Google:

root@debian82:/home/user# ping google.com ping: unknown host
google.com

I've tried switching to dhcp and refreshing its config.:

 root@debian82:/home/user# dhclient -r -v eth0 && rm
 /var/lib/dhcp/dhclient.*; dhclient -v eth0 Internet Systems Consortium
 DHCP Client 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All
 rights reserved. For info, please visit
 https://www.isc.org/software/dhcp/

 Listening on LPF/eth0/00:02:a5:b5:e1:eb Sending on  
 LPF/eth0/00:02:a5:b5:e1:eb Sending on   Socket/fallback DHCPRELEASE on
 eth0 to 10.0.0.138 port 67 Internet Systems Consortium DHCP Client
 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/

 Listening on LPF/eth0/00:02:a5:b5:e1:eb Sending on  
 LPF/eth0/00:02:a5:b5:e1:eb Sending on   Socket/fallback DHCPDISCOVER
 on eth0 to 255.255.255.255 port 67 interval 5 DHCPREQUEST on eth0 to
 255.255.255.255 port 67 DHCPOFFER from 10.0.0.138 DHCPACK from 10.0.0.138 bound to 10.0.0.11 -- renewal in 110048 seconds.

Here's what I got:

etc/networking/interfaces

allow-hotplug eth0
auto eth0
iface eth0 inet dhcp
#       address 10.0.0.11
#       netmask 255.255.255.0
#       gateway 10.0.0.138
        nameserver 8.8.8.8
        nameserver 194.90.0.1
        dns-nameservers 8.8.8.8 194.90.0.1 8.8.4.4

I tried everything I could possibly find, and rebooted between each trial. Where am I wrong? The content of /etc/resolv.conf is:

user@debian82:~$ nano /etc/resolv.conf
nameserver 10.0.0.138

EDIT: I've added the other name servers (Google's and ISP's) to /etc/resolv.conf. I'm writing this edit from the computer that had no internet.

  • Why are the comments there? – Rui F Ribeiro Nov 16 '15 at 18:31
  • I tried static configuration and dhcp config. Then DHCP just with DNS name servers. – Phantom Nov 16 '15 at 18:49
  • please show the output of netstat -rn or ss output. And your /etc/resolv.conf – Rui F Ribeiro Nov 17 '15 at 5:01
  • Thanks. I've added the DNS name server to etc/resolv.conf and now it works. – Phantom Nov 17 '15 at 13:25
1

Adding other name servers to /etc/resolv.conf fixed the problem. Before it looked like:

user@debian82:~$ nano /etc/resolv.conf
nameserver 10.0.0.138

Now it looks like:

user@debian82:~$ nano /etc/resolv.conf
nameserver 10.0.0.138
nameserver <ISP's dns name server>
nameserver 8.8.8.8 <(Google's)>

And the connection is resumed:

PING google.com (194.90.196.110) 56(84) bytes of data.
64 bytes from 194.90.196.110: icmp_seq=1 ttl=59 time=14.5 ms
64 bytes from 194.90.196.110: icmp_seq=2 ttl=59 time=15.9 ms
64 bytes from 194.90.196.110: icmp_seq=3 ttl=59 time=15.3 ms
64 bytes from 194.90.196.110: icmp_seq=4 ttl=59 time=14.0 ms
64 bytes from 194.90.196.110: icmp_seq=5 ttl=59 time=15.3 ms
^C
--- google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 5882ms
rtt min/avg/max/mdev = 14.030/15.048/15.930/0.669 ms
  • debug the 10.0.0.138 with nslookup and dig. Be aware that if the IP is given via DHCP, this file will be modified again soon automatically. – Rui F Ribeiro Nov 17 '15 at 13:29

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.