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.

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: unknown host

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 –  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 it shows googles IP and mail servers. –  Subhransu Apr 4 '13 at 14:29
@Patrick please the nsswitch.conf has hosts: files dns entry in it. –  Subhransu 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

1 Answer 1

up vote 1 down vote accepted

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

Check out 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 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.