sudo gedit /etc/resolv.conf
修改如下:替换nameserver的地址
#nameserver 127.0.0.53
nameserver 8.8.8.8
DNS on the NAT Network The NAT device acts as a DNS server for the
virtual machines on the NAT network. Actually, the NAT device is a DNS
proxy and merely forwards DNS requests from the virtual machines to a
DNS server that is known by the host. Responses come back to the NAT
device, which then forwards them to the virtual machines.If they get their configuration information from DHCP, the virtual
machines on the NAT network automatically use the NAT device as the
DNS server. However, the virtual machines can be statically configured
to use another DNS server.The virtual machines in the private NAT network are not, themselves,
accessible via DNS. If you want the virtual machines running on the
NAT network to access each other by DNS names, you must set up a
private DNS server connected to the NAT network.
来源:CSDN
作者:qq_38963393
链接:https://blog.csdn.net/qq_38963393/article/details/104284263