添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

nslookup报告说 "不能解决'(null)'。名称不能解析",尽管它成功地解析了DNS名称

28 人关注

我在ubuntu上,正在运行一个docker默认的桥梁网络。我有容器化版本的zookeeper、kafka和我写的一个与kafka对话的应用程序。

我做了一个。

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

然后在我的应用程序的容器中,我运行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

我不明白为什么我得到的输出是 "不能解决'(null)'",然后我又得到了预期的ip地址打印出来。我试着用谷歌搜索nslookup和这个输出信息,但我无法理解为什么会发生这种情况。

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
    
1 个评论
linux
ubuntu
docker
dns
nslookup
smuggledPancakes
smuggledPancakes
发布于 2017-09-28
1 个回答
Sam
Sam
发布于 2019-07-17
已采纳
0 人赞同

这是nslookup的一个错误/缺陷。 不能解决 "的信息实际上是关于正在使用的DNS服务器,而不是你试图查找的网站。

例如,这个查询(告诉nslookup使用8.8.8.8的DNS服务器查询google.com)没有错误信息。

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