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 am compiling my own 3.14 kernel. I fear I may have left out some important networking feature to get DNS working.

I can't resolve domain names. I can ping my DNS server. I can resolve using that DNS on other machines so I know it's not the server.

~ # cat /etc/resolv.conf

~ # nslookup google.com
Address 1:

nslookup: can't resolve 'google.com'

~ # ping -c 1 google.com
ping: bad address 'google.com'

~ # ping -c 1 
PING ( 56 data bytes
64 bytes from seq=0 ttl=128 time=0.382 ms

--- ping ststistics ---
1 packets transmitted, 1 packets recieved, 0% packet loss
reound-trip min/avg/max = 0.382/0.382/0.382 ms

Any ideas what I left out? here is my config: http://pastebin.com/vt4vGTgJ


If it's not the kernel, what could I be missing? I am using busybox, statically linked. there are no shared libraries in this system.

share|improve this question
Do you have any firewall configured? If so, do you block port 53 UDP/TCP? – Jenny D Apr 11 '14 at 14:03
No firewall, no block on port 53. I can access the DNS from another machine on the same subnet. – AllenKll Apr 11 '14 at 14:04
As far as i iknow you can't just disable DNS functionality by .config-options from your kernel. – Bonsi Scott Apr 11 '14 at 14:07
Are you sure that your DNS server @ is allowing recursive queries? For example, if you dig @ www.google.com do you get any additional info? Can you perform recursive queries against your DNS server from other machines? – Chipster Apr 11 '14 at 14:54
your kernel seems to be Ok, but your DNS resolving does not work. Did you obtain the nameserver IP from DHCP? is route set? try a different nameserver i.e. nameserver – user55518 Apr 11 '14 at 15:12
up vote 1 down vote accepted

The problem is with busybox. I switched to a precompiled version and did not have issues. I need to look into compilation options with it. Thanks for your help.


There are known issues with DNS functionality in statically-linked glibc programs (like busybox in this case), because libnss must be dynamically loaded. Building a uClibc toolchain and linking busybox against that would resolve this.

share|improve this answer

I'm not sure if this is the same problem I had or not, but I recently upgraded and old internal DNS server system from OpenBSD 3.8 to 5.6, and I lost the ability to resolve hosts with ping, but the host command was working. Turned out I had to add to the match-clients directive in named in addition to the which I already had there, and then it started to work properly after restarting named.

share|improve this answer

I had the same problem. I've used buildroot to build the filesystem, to compile the kernel and to add extra packages with busybox.

I was only able to ping an ip address. With url the ping command returned: bad address error. Then I changed the resolv.conf file.

sudo vim /etc/resolv.conf

nameserver gateway_ip_address

And everything worked fine.

share|improve this answer
That does not seem to solve the problem for me. As OP mentioned, it seems to be down to libnss not working when statically linked. Compiling busybox with uclibc (and udhcpc) seems to solve the issue for me. – Attila O. Jan 13 '15 at 10:19

I resolved the same symptoms by editing: /etc/nsswitch.conf and adding DNS to the following line:

hosts:      files dns
share|improve this answer

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.