名称解析适用于主机,但其他情况下失败

名称解析适用于主机,但其他情况下失败

Windows 10 上的 Ubuntu bash

我遇到一个问题,host 和 nslookup 命令可以正常解析所有主机,但其他所有命令都无法解析域。见下文:

user@computer:/mnt/c/Users/user$ host google.com
 google.com has address 172.217.12.174
 google.com has IPv6 address 2607:f8b0:4006:81a::200e
 google.com mail is handled by 50 alt4.aspmx.l.google.com.
 google.com mail is handled by 30 alt2.aspmx.l.google.com.
 google.com mail is handled by 40 alt3.aspmx.l.google.com.
 google.com mail is handled by 10 aspmx.l.google.com.
 google.com mail is handled by 20 alt1.aspmx.l.google.com.
user@computer:/mnt/c/Users/user$ ping google.com
 ping: google.com: Temporary failure in name resolution
user@computer:/mnt/c/Users/user$ cat /etc/resolv.conf
 nameserver 8.8.8.8
 search domain.com
user@computer:/mnt/c/Users/user$ lsb_release -a
 No LSB modules are available.
 Distributor ID: Ubuntu
 Description:    Ubuntu 18.04.1 LTS
 Release:        18.04
 Codename:       bionic
user@computer:/mnt/c/Users/user$ ping 8.8.8.8
 PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
 64 bytes from 8.8.8.8: icmp_seq=1 ttl=122 time=18.6 ms
 64 bytes from 8.8.8.8: icmp_seq=2 ttl=122 time=17.7 ms

答案1

这是 Windows 已将更新应用于子系统但尚未重新启动的问题。完全重新启动(Windows,而不是 Linux 子系统)可解决此问题。

相关内容