Take the 2-minute tour ×
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.

I have booted Debian Wheezy from SD card on a Beaglebone Black board. Version: debian-wheezy-7.0.0-armhf-3.8.13-bone20.img.xz, from http://www.armhf.com/index.php/download/

I have set up my /etc/networks/interfaces file:

auto lo
iface lo inet loopback

auto eth2

iface eth2 inet static
    address 192.168.1.101
    netmask 255.255.255.0
    gateway 192.168.1.2
    dns-nameservers 8.8.8.8 8.8.8.9
# wireless network interface
#auto wlan0
#iface wlan0 inet dhcp

When I ping 8.8.8.8:

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=1 ttl=44 time=32.3 ms
64 bytes from 8.8.8.8: icmp_req=2 ttl=44 time=29.3 ms
64 bytes from 8.8.8.8: icmp_req=3 ttl=44 time=30.3 ms

route -n

0.0.0.0         192.168.1.2     0.0.0.0         UG    0      0        0 eth2
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth2

ifconfig -a

eth2      Link encap:Ethernet  HWaddr 90:59:af:5c:f9:ca
      inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
      inet6 addr: fe80::9259:afff:fe5c:f9ca/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:463 errors:0 dropped:0 overruns:0 frame:0
      TX packets:182 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000
      RX bytes:91607 (89.4 KiB)  TX bytes:14680 (14.3 KiB)
      Interrupt:56

lo        Link encap:Local Loopback
      inet addr:127.0.0.1  Mask:255.0.0.0
      inet6 addr: ::1/128 Scope:Host
      UP LOOPBACK RUNNING  MTU:65536  Metric:1
      RX packets:2 errors:0 dropped:0 overruns:0 frame:0
      TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0
      RX bytes:190 (190.0 B)  TX bytes:190 (190.0 B)

But when I ping google.com

ping: unknown host google.com

I can also ping other devices on network, but can't access internet.

Any idea what is wrong?

EDIT1:

cat /etc/resolv.conf

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.8.9

cat /etc/nsswitch.conf

# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
share|improve this question
    
also give us output of grep dns /etc/nsswitch.conf –  Rahul Patil Sep 9 '13 at 14:42
    
If you can ping an IP address, then you are connected to the internet. What remains is to make DNS resolution work, as per answers below. –  Jenny D Feb 25 at 8:52
    
Late to the party. Had a similar issue today on Debian 7, it ended up being the IP I was assigning it was outside my LAN range on the router. Changed it inside the range and it worked. –  Brad F Jacobs Sep 7 at 23:29

3 Answers 3

The secondary server is at is at 8.8.4.4, not 8.8.8.9.

share|improve this answer

You need to add your DNS settings to the /etc/resolv.conf file. If you edit the file to contain something like the following it should work:

nameserver 8.8.8.8
share|improve this answer

In order for the dns-nameservers directive to work in /etc/network/interfaces you need to have a separate package resolvconf. You can check /etc/resolv.conf to see if the interfaces are there. If they are not, install the resolvconf package and restart the interface:

apt-get install resolvconf
ifdown eth2
ifup eth2
share|improve this answer
    
it should be default installed, isn't it ? –  Rahul Patil Sep 9 '13 at 14:40
    
@RahulPatil I have no idea what they install by default in their images. In stock Debian, it is not. –  jordanm Sep 9 '13 at 14:42
    
if dns not get resolve, then how package will install ? –  Rahul Patil Sep 9 '13 at 14:44
    
@RahulPatil by first performing the steps in Lorax's answer. –  jordanm Sep 9 '13 at 14:45
    
The resolvconf is installed. However the file /etc/resolv.conf says that I shouldn't edit it, but it's set correctly. I added cat /etc/resolv.conf in my question. –  zdun8 Sep 9 '13 at 15:33

Your Answer

 
discard

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.