I have a weird PING error in WSL2, Ubuntu 20.04 distribution. When I'm doing nslookup - all ok:
root@i:~# nslookup google.com
Server: 172.19.224.1
Address: 172.19.224.1#53
Non-authoritative answer:
Name: google.com
Address: 142.250.185.206
Name: google.com
Address: 2a00:1450:4001:830::200e
root@i:~#
When I'm pinging by address - also ok:
root@i:~# ping 142.250.185.206
PING 142.250.185.206 (142.250.185.206) 56(84) bytes of data.
64 bytes from 142.250.185.206: icmp_seq=1 ttl=113 time=45.9 ms
64 bytes from 142.250.185.206: icmp_seq=2 ttl=113 time=45.1 ms
64 bytes from 142.250.185.206: icmp_seq=3 ttl=113 time=45.1 ms
^C
--- 142.250.185.206 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 45.066/45.382/45.941/0.396 ms
root@i:~#
But when I'm trying to PING by name - get error:
root@i:~# ping google.com
ping: google.com: System error
root@i:~#
Strace tells me something about "access denied", but what could deny this access? Can't find anything about that.
https://pastebin.com/SpDZuX1c - strace with error
This:
openat(AT_FDCWD, "/etc/nsswitch.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
stat("/etc/resolv.conf", 0x7ffea50eddb0) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/etc/host.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/etc/resolv.conf", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
is really weird.
All files must be accessible:
root@i:~# stat /etc/resolv.conf
File: /etc/resolv.conf
Size: 198 Blocks: 8 IO Block: 4096 regular file
Device: 810h/2064d Inode: 90071 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-02-04 16:14:10.859833659 +0300
Modify: 2022-02-04 15:43:48.419820525 +0300
Change: 2022-02-04 15:43:48.419820525 +0300
Birth: -
root@i:~# stat /usr/bin/ping
File: /usr/bin/ping
Size: 72776 Blocks: 144 IO Block: 4096 regular file
Device: 810h/2064d Inode: 7392 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-02-04 10:43:28.684002234 +0300
Modify: 2020-01-31 02:11:23.000000000 +0300
Change: 2022-02-04 10:43:21.754002185 +0300
Birth: -
root@i:~#
root@i:~# getcap /usr/bin/ping
/usr/bin/ping = cap_net_raw+ep
root@i:~#
PING run from root.
Cannot enable auditd because its WSL.
curl, traceroute, nslookup, telnet - all is working perfectly, only PING has problems.
I'm totally confused and don't know where to look and what to fix.
0 Answers