要通过名称访问网络上的其他计算机,我必须将以下两行添加到我的/etc/resolv.conf
:
search foo.local
nameserver 192.168.X.Y
Run Code Online (Sandbox Code Playgroud)
但我所做的任何更改在重新启动后都不会保留。
这是 my 的内容/etc/resolv.conf
,它实际上是以下符号链接/run/systemd/resolve/stub-resolv.conf
:
$ cat /etc/resolv.conf
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "systemd-resolve --status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must …
Run Code Online (Sandbox Code Playgroud)