Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just have setup a Linux server. But currently I am having problem in connecting to the outside world. I am not able to do wget,apt-get or ping. Here ar some relevant details:

$ping google.com
ping: unknown host google.com

cat /etc/resolv.conf

search dmust.local

vim /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        # dns-* options are implemented by the resolvconf package, if installed
        dns-search dmust.local


route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface   U     0      0        0 eth0         UG    100    0        0 eth0

grep '^hosts' /etc/nsswitch.conf
hosts:          files dns
share|improve this question
Give the output of route -n instead of route since we don't know what localnet is. But it looks like the problem may be your nameserver. Try ping and if that works, try host google.com – depquid Apr 3 '13 at 18:14
In addition to what depquid said, can you also provide grep '^hosts' /etc/nsswitch.conf? – Patrick Apr 3 '13 at 18:22
@depquid it works, both ping and host google.com it shows googles IP and mail servers. – Subhransu Mishra Apr 4 '13 at 14:29
@Patrick please the nsswitch.conf has hosts: files dns entry in it. – Subhransu Mishra Apr 4 '13 at 14:34
The problem is probably that your namerserver is invalid or broken. Where did you get from for the nameserver? – depquid Apr 4 '13 at 15:03
up vote 1 down vote accepted

You need to get the incorrect nameserver out of your configuration.

Check out https://help.ubuntu.com/12.10/serverguide/network-configuration.html#name-resolution for more information.

To use Google's free nameservers, edit your /etc/network/interfaces file as below.





And then restart your network interface, via

$ sudo /etc/init.d/networking restart

share|improve this answer
Thanks depquid and me.sedal for melping me out, it did resolved the issue . – Subhransu Mishra Apr 6 '13 at 17:10

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.