1、系统版本 Ubuntu 18.04.3
root@vm-sw:/etc/apt# sudo chattr +i /etc/resolv.conf
sudo: unable to resolve host vm-sw
chattr: Operation not supported while reading flags on /etc/resolv.conf
root@vm-sw:/etc/apt# ls -l /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Aug 5 2019 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
root@vm-sw:/etc/apt# mv /etc/resolv.conf /etc/resolv.conf.link
root@vm-sw:/etc/apt# cat /etc/resolv.conf.link
# 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 not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 114.114.114.114
nameserver 127.0.0.53
options edns0
root@vm-sw:/etc/apt# cat /etc/resolv.conf.link >/etc/resolv.conf
root@vm-sw:/etc/apt# ls -la /etc/resolv.conf*
-rw-r--r-- 1 root root 742 Nov 4 08:21 /etc/resolv.conf
lrwxrwxrwx 1 root root 39 Aug 5 2019 /etc/resolv.conf.link -> ../run/systemd/resolve/stub-resolv.conf
root@vm-sw:/etc/apt# 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 not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 114.114.114.114
nameserver 127.0.0.53
options edns0
root@vm-sw:/etc/apt# chattr +i /etc/resolv.conf
root@vm-sw:/etc/apt# cat /etc/issue
Ubuntu 18.04.3 LTS \n \l