本文介绍了nslookup报告“无法解析'(null)':名称无法解析".尽管它成功解析了DNS名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ubuntu上,并且正在运行docker默认桥网络.我有Zookeeper,kafka的容器化版本,以及我编写的与kafka对话的应用程序.

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.

我这样做:

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

然后在我的应用程序容器中运行nslookup kafka

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

我不明白为什么我得到输出无法解析'(null)'",然后在以后输出期望的IP地址.我试图用google搜索nslookup和此输出消息,但我不知道为什么会发生这种情况.

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.

我的/etc/resolv.conf文件如下:

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

推荐答案

这是nslookup中的错误/怪癖. 无法解析"消息实际上是有关正在使用的DNS服务器的信息,而不是您要查找的站点的信息.

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.

例如,该查询(告诉nslookup使用8.8.8.8 DNS服务器查找google.com)没有错误消息:

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

但是此查询(DNS服务器为"null")确实显示错误":

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

诚然,这是令人误解/令人困惑的,确实应该在nslookup中修复.

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

这篇关于nslookup报告“无法解析'(null)':名称无法解析".尽管它成功解析了DNS名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 03:49