Super User is a question and answer site for computer enthusiasts and power users. 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 have a STATIC IP address on my network.

I can ping one of Google's servers:

root@napajohn:~# ping
PING ( 56(84) bytes of data.
64 bytes from icmp_req=2 ttl=49 time=76.5 ms
64 bytes from icmp_req=3 ttl=49 time=75.6 ms
64 bytes from icmp_req=4 ttl=49 time=76.6 ms
64 bytes from icmp_req=5 ttl=49 time=76.6 ms

But I can't resolve any hostnames:

root@napajohn:~# ping
ping: unknown host

I should note that I am behind a proxy, but that shouldn't affect not resolving names. I can't resolve my proxy's name either.

These are the contents of my /etc/hosts file:

root@napajohn:~# cat /etc/hosts       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters napadev

These are the contents of my /etc/networks file:

root@napajohn:~# cat /etc/networks

These are the contents of my /etc/network/interfaces file:

root@napajohn:~# cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#default bootstrap static address
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static

This is the content of my /etc/netswitch.conf file:

root@napajohn:~# 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

Some output of various commands:


root@napajohn:~# getent hosts       localhost       localhost ip6-localhost ip6-loopback       napadev


root@napajohn:~# find / -name resolv*


root@napajohn:~# find / -name named.*


root@napajohn:~# grep -riI dns /etc
/etc/insserv.conf:$named                +named +dnsmasq +lwresd +bind9 $network
/etc/lynx-cur/lynx.cfg:# until a valid Internet host is created, based on a successful DNS
/etc/lynx-cur/lynx.cfg:# no-proxy zones in the DNS domain name space.  If a tail substring of the
/etc/services:mdns              5353/tcp                        # Multicast DNS
/etc/services:mdns              5353/udp                        # Multicast DNS
/etc/udhcpd.conf:# as the dns option, they can be listed on the same line, or multiple
/etc/udhcpd.conf:opt    dns
/etc/udhcpd.conf:option dns   # appened to above DNS servers for a total of 3
/etc/udhcpd.conf:#opt dns
/etc/profile.d/ NAPA_DNS=''
/etc/ssh/ssh_config:#   GSSAPITrustDNS no
/etc/nsswitch.conf:hosts:          files dns


root@napajohn:~# grep -riI name-server /etc
root@napajohn:~# grep -riI nameserver /etc
/etc/services:nameserver        42/tcp          name            # IEN 116


root@napajohn:~# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:15:c9:28:e3:96
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::215:c9ff:fe28:e396/64 Scope:Link
          RX packets:16863 errors:0 dropped:0 overruns:0 frame:0
          TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1586688 (1.5 MiB)  TX bytes:13557 (13.2 KiB)

lo        Link encap:Local Loopback
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:900 errors:0 dropped:0 overruns:0 frame:0
          TX packets:900 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:72008 (70.3 KiB)  TX bytes:72008 (70.3 KiB)

I have spent a couple hours trying to figure out potential causes of this problem, but from what I have read and tried so far, everything seems normal (as in what people have suggested in other threads is already fine/exists on my machine), except that I do not have an /etc/named.conf file nor do I have an /etc/resolv.conf file. I could create them (how would I even know what to put in?) but I don't think that would solve the problem. Suggestions?

I am running:

root@napajohn:~# cat /etc/debian_version
root@napajohn:~# uname -a
Linux napajohn 2.6.34 #4 Mon Oct 31 16:41:13 EDT 2011 armv7l GNU/Linux

Edit 1, after strkol's comment:

root@napajohn:~# echo "nameserver" > /etc/resolv.conf
root@napajohn:~# ping
ping: unknown host
share|improve this question

migrated from Apr 17 '12 at 9:49

This question came from our site for professional and enthusiast programmers.

still no dice, but ping now tries a little long before giving up, as opposed to immediately outputting "could not resolve host" – John E Apr 16 '12 at 19:52
up vote 5 down vote accepted

You need the /etc/resolv.conf file. It tells the server what nameservers to use as resolvers. I suspect your server is currently trying to use itself and you don't have named configured to act as a resolver.

Ask your ISP or hosting provider what nameservers to use as resolvers. If all else fails, put the following in /etc/resolv.conf, these two should work:

share|improve this answer
Thank you. Those nameservers didn't work for me, but your response caused me to look at that file on another machine that was once connected to our network, and lo and behold it existed had two addresses. I added those, and now I have DNS access. Probem resolved! (pun intended) – John E Apr 16 '12 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .