Ped*_*ozi 5 fedora dns resolv.conf
在 Fedora 32 中,我曾经/etc/resolv.conf为了修改 DNS 地址进行编辑:
nameserver [IP1]
nameserver [IP2]
Run Code Online (Sandbox Code Playgroud)
但是在 Fedora 33 中,此文件已更改,并且有一条警告说Do not edit:
# 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 "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically 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 127.0.0.53
options edns0 trust-ad
Run Code Online (Sandbox Code Playgroud)
如何修改名称服务器以便我可以使用自定义 DNS 地址?
resolvectl dns
Global:
Link 2 (enp2s0):
Link 3 (wlp1s0): 192.168.43.63
Run Code Online (Sandbox Code Playgroud)
sudo resolvectl dns wlp1s0 8.8.8.8 4.4.4.4
Run Code Online (Sandbox Code Playgroud)
resolvectl dns
Global:
Link 2 (enp2s0):
Link 3 (wlp1s0): 8.8.8.8 4.4.4.4
Run Code Online (Sandbox Code Playgroud)