Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

nslookup reported "can't resolve '(null)': Name does not resolve" though it successfully resolved the DNS names

Ask Question

I am on ubuntu, and I am running a docker default bridge network. I have containerized versions of zookeeper, kafka, and an app that I wrote that talks to kafka.

I do a:

docker exec -it <my-app id> /bin/bash

Then inside my app's container I run nslookup kafka

/go # nslookup schmafka
nslookup: can't resolve '(null)': Name does not resolve
Name:      schmafka
Address 1: 172.20.0.8 docker_kafka_1.docker_default

I do not understand why I get the output "can't resolve '(null)'" and then I get the expected ip address printed out later. I tried to google nslookup and this output message but I cannot figure why this happens.

My /etc/resolv.conf file looks like this:

/go # cat /etc/resolv.conf 
search valhalla.local valhalla v
nameserver 127.0.0.11
options ndots:0
                Seems like other are also facing similar issues when options are there forums.docker.com/t/…, github.com/docker-library/busybox/issues/27 and github.com/moby/moby/issues/29398
– Tarun Lalwani
                Sep 28, 2017 at 6:54

This is a bug/oddity in nslookup. The "can't resolve" message is actually about the DNS server in use, not the site you are trying to look up.

For example this query (which tells nslookup to lookup google.com using the 8.8.8.8 DNS server) has no error message:

nslookup google.com 8.8.8.8
Server:    8.8.8.8
Address 1: 8.8.8.8 dns.google
Name:      google.com
Address 1: 172.217.164.110 sfo03s18-in-f14.1e100.net
Address 2: 2607:f8b0:4005:80b::200e sfo03s18-in-x0e.1e100.net

But this query (in which the DNS server is "null") does show the "error":

UAP-AC-LR1-BZ.v4.0.42# nslookup google.com
nslookup: can't resolve '(null)': Name does not resolve
Name:      google.com
Address 1: 172.217.164.110 sfo03s18-in-f14.1e100.net
Address 2: 2607:f8b0:4005:80b::200e sfo03s18-in-x0e.1e100.net

Admittedly this is misleading/confusing, and really should be fixed in nslookup.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.