ping não pode resolver o nome do host, mas o nslookup pode, no Ubuntu 17.04

1

Então, ping realmente não usa DNS?

Aqui está o meu caso:

$ 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

Tudo parece bom. Agora:

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

Mas o ping no IP funciona. Então, como sugerido em avahi: ping não pode resolver o nome do host, mas o nslookup pode , eu fiz um strace ping , e sua saída está incluída na parte inferior, do Ubuntu 17.04 zesty.

Após " O ping não consegue encontrar o host, mas o NSLookup resolve tudo bem ", eu desativei o IPV6 também:

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

Mas o problema continua o mesmo.
Por favor ajude.

PS. O strace ping output:

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)=[{"
$ 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
AUTH 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\t25\f71C0479|", 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
$ ping maroon
ping: maroon: Name or service not known
$ cat /proc/sys/net/ipv6/conf/all/disable_ipv6
1
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)=[{"%pre%AUTH 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\t25\f71C0479|", 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%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%m%pre%%pre%%pre%o%pre%%pre%%pre%%pre%/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\r%pre%%pre%%pre%%pre%%pre%%pre%E%pre%%pre%%pre%s%pre%%pre%%pre%%pre%", 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%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%u%pre%%pre%%pre%%pre%g%pre%s%pre%%pre%"..., 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 %pre%%pre%%pre%%pre%%pre%%pre%2%pre%%pre%%pre%o%pre%%pre%%pre%%pre%/org/fre"..., 184}, {"%pre%%pre%%pre%%pre%%pre%%pre%%pre%maroon%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 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\r%pre%%pre%%pre%%pre%%pre%%pre%5%pre%%pre%%pre%o%pre%%pre%%pre%%pre%", 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%pre%%pre%%pre%s%pre%%pre%%pre%%pre%"..., 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<%pre%%pre%%pre%.1%pre%f%pre%%pre%%pre%u%pre%%pre%%pre%%pre%", 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)=[{"s%pre%%pre%%pre%%pre%:1.59975%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%s%pre%\"%pre%%pre%%pre%"..., 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
%pre%%pre%%pre%%pre%%pre%m%pre%%pre%%pre%o%pre%%pre%%pre%%pre%/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\r%pre%%pre%%pre%%pre%%pre%%pre%E%pre%%pre%%pre%s%pre%%pre%%pre%%pre%", 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%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%u%pre%%pre%%pre%%pre%g%pre%s%pre%%pre%"..., 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 %pre%%pre%%pre%%pre%%pre%%pre%2%pre%%pre%%pre%o%pre%%pre%%pre%%pre%/org/fre"..., 184}, {"%pre%%pre%%pre%%pre%%pre%%pre%%pre%maroon%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%", 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\r%pre%%pre%%pre%%pre%%pre%%pre%5%pre%%pre%%pre%o%pre%%pre%%pre%%pre%", 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%pre%%pre%%pre%s%pre%%pre%%pre%%pre%"..., 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<%pre%%pre%%pre%.1%pre%f%pre%%pre%%pre%u%pre%%pre%%pre%%pre%", 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)=[{"s%pre%%pre%%pre%%pre%:1.59975%pre%%pre%%pre%%pre%%pre%%pre%%pre%%pre%s%pre%\"%pre%%pre%%pre%"..., 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

Ou seja, no meu Ubuntu 17.04 zesty, o ping parece estar consultando /sys/fs/kdbus/0-system/bus , o que resulta em

Resource temporarily unavailable

Este parece ser um problema específico do Ubuntu 17.04, já que eu tenho a mesma configuração no Ubuntu 16.04 antes, e não houve problemas então.

Qualquer ajuda?

    
por xpt 30.05.2017 / 00:23

1 resposta

1

Tente alterar o /etc/nsswitch.conf conforme mostrado aqui:

link

    
por 14.11.2017 / 00:31