web-dev-qa-db-ja.com

Ubuntu 17.04では、pingはホスト名を解決できませんが、nslookupは解決できます

では、pingは本当にDNSを使用していませんか?

これが私の場合です:

$ nslookup maroon
Server:         192.168.2.102
Address:        192.168.2.102#53

maroon  canonical name = coral.
Name:   coral
Address: 192.168.2.102

$ Dig maroon
;; ANSWER SECTION:
maroon.                 0       IN      CNAME   coral.
coral.                  0       IN      A       192.168.2.102

すべてよさそうだ。今:

$ ping maroon
ping: maroon: Name or service not known

ただし、IPへのpingは機能します。したがって、 avahi:pingはホスト名を解決できませんが、nslookupは解決できます で提案されているように、私はstrace pingを実行し、その出力はUbuntu 17.04zestyから下部に囲まれています。

Pingはホストを見つけることができませんが、NSLookupは正常に解決します 」に続いて、IPV6もオフにしました。

$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1

しかし、問題は同じままです。
助けてください。

PS。 strace ping出力:

7062  open("/sys/fs/kdbus/0-system/bus", O_RDWR|O_NOCTTY|O_CLOEXEC) = -1 ENOENT (N
o such file or directory)
7062  socket(AF_LOCAL, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 5
7062  getsockopt(5, SOL_SOCKET, SO_RCVBUF, [212992], [4]) = 0
7062  setsockopt(5, SOL_SOCKET, SO_RCVBUFFORCE, [8388608], 4) = -1 EPERM (Operation not permitted)
7062  setsockopt(5, SOL_SOCKET, SO_RCVBUF, [8388608], 4) = 0
7062  getsockopt(5, SOL_SOCKET, SO_SNDBUF, [212992], [4]) = 0
7062  setsockopt(5, SOL_SOCKET, SO_SNDBUFFORCE, [8388608], 4) = -1 EPERM (Operation not permitted)
7062  setsockopt(5, SOL_SOCKET, SO_SNDBUF, [8388608], 4) = 0
7062  connect(5, {sa_family=AF_LOCAL, Sun_path="/var/run/dbus/system_bus_socket"}, 33) = 0
7062  getsockopt(5, SOL_SOCKET, SO_PEERCRED, {pid=1, uid=0, gid=0}, [12]) = 0
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 201194451}) = 0
7062  fstat(5, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0
7062  getsockopt(5, SOL_SOCKET, SO_ACCEPTCONN, [0], [4]) = 0
7062  getsockname(5, {sa_family=AF_LOCAL, NULL}, [2]) = 0
7062  geteuid()                         = 0
7062  sendmsg(5, {msg_name(0)=NULL, msg_iov(3)=[{"\0AUTH EXTERNAL ", 15}, {"30", 2}, {"\r\nNEGOTIATE_UNIX_FD\r\nBEGIN\r\n", 28}], msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 45
7062  gettid()                          = 7062
7062  getrandom("B\t\26\262\335\6\f\33\337\321C\250\374\2779|", 16, GRND_NONBLOCK) = 16
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 201935158}) = 0
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202039305}) = 0
7062  recvmsg(5, 0x7ffdff00f5e0, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202205684}) = 0
7062  ppoll([{fd=5, events=POLLIN}], 1, {24, 998989000}, NULL, 8) = 1 ([{fd=5, revents=POLLIN}], left {24, 998979401})
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202392820}) = 0
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"OK 46f9158405c271efea96759d59263"..., 256}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 52
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202572558}) = 0
7062  sendmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"l\1\0\1\0\0\0\0\1\0\0\0m\0\0\0\1\1o\0\25\0\0\0/org/fre"..., 128}], msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 128
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202751135}) = 0
7062  recvmsg(5, 0x7ffdff00f540, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 202897197}) = 0
7062  ppoll([{fd=5, events=POLLIN}], 1, {24, 999038000}, NULL, 8) = 1 ([{fd=5, revents=POLLIN}], left {24, 997085204})
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 205068245}) = 0
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"l\2\1\1\r\0\0\0\1\0\0\0E\0\0\0\6\1s\0\10\0\0\0", 24}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 24
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{":1.59975\0\0\0\0\0\0\0\0\5\1u\0\1\0\0\0\10\1g\0\1s\0\0"..., 77}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 77
7062  sendmsg(5, {msg_name(0)=NULL, msg_iov(2)=[{"l\1\2\1 \0\0\0\2\0\0\0\242\0\0\0\1\1o\0\31\0\0\0/org/fre"..., 184}, {"\0\0\0\0\6\0\0\0maroon\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 32}], msg_controllen=0, msg_flags=0}, MSG_DONTWAIT|MSG_NOSIGNAL) = 216
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 205502630}) = 0
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"l\4\1\1\r\0\0\0\2\0\0\0\225\0\0\0\1\1o\0\25\0\0\0", 24}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 24
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"/org/freedesktop/DBus\0\0\0\2\1s\0\24\0\0\0"..., 157}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 157
7062  recvmsg(5, 0x7ffdff00f670, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)
7062  clock_gettime(CLOCK_MONOTONIC, {416062, 205942095}) = 0
7062  ppoll([{fd=5, events=POLLIN}], 1, {44, 999560000}, NULL, 8) = 1 ([{fd=5, revents=POLLIN}], left {44, 131613738})
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"l\3\1\1<\0\0\0.\241\3\0f\0\0\0\5\1u\0\2\0\0\0", 24}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 24
7062  recvmsg(5, {msg_name(0)=NULL, msg_iov(1)=[{"\6\1s\0\10\0\0\0:1.59975\0\0\0\0\0\0\0\0\4\1s\0\"\0\0\0"..., 156}], msg_controllen=0, msg_flags=MSG_CMSG_CLOEXEC}, MSG_DONTWAIT|MSG_NOSIGNAL|MSG_CMSG_CLOEXEC) = 156
7062  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
7062  close(5)                          = 0
7062  open("/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 5

つまり、私のUbuntu 17.04 zestyでは、ping/sys/fs/kdbus/0-system/busを参照しているようで、その結果、

リソースが一時的に利用できません

以前Ubuntu16.04で同じセットアップを行っていたので、これはUbuntu 17.04固有の問題のようですが、当時は問題はありませんでした。

何か助けはありますか?

1
xpt

次に示すように、/ etc /nsswitch.confを変更してみてください。

http://stuartfeeser.com/2013/02/11/ubuntu/

1
ParoXoN