gpt4 book ai didi

linux - nslookup 报告 "can' t 解析 '(null)' : Name does not resolve"though it successfully resolved the DNS names

转载 作者:IT老高 更新时间:2023-10-28 21:26:16 26 4
gpt4 key购买 nike

我在 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 和这个输出消息,但我不知道为什么会发生这种情况。

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

/go # cat /etc/resolv.conf 
search valhalla.local valhalla v
nameserver 127.0.0.11
options ndots: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

但是这个查询(其中 DNS 服务器为“null”)确实显示了“错误”:

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 中修复。

关于linux - nslookup 报告 "can' t 解析 '(null)' : Name does not resolve"though it successfully resolved the DNS names,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46457136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com