1. 程式人生 > 實用技巧 >systemd-resolved and resolvctl on ubuntu; 127.0.0.53 nameserver;

systemd-resolved and resolvctl on ubuntu; 127.0.0.53 nameserver;

前段時間,我偶然進行檢視linux DNS配置,通過檢視 /etc/resolv.conf 檔案,得到如下結果:

➜  devices ll /etc/resolv.conf
lrwxrwxrwx 1 root root 39 12月 28 18:55 /etc/resolv.conf -> ../run/systemd/resolve/stub-resolv.conf
➜  devices 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 "resolvectl 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 127.0.0.53 options edns0 trust-ad

我之前,曾經簡單寫過一個linux 下,如何獲取dns伺服器的部落格:

Linux 中檢視 DNS 與 配置;但是無論怎麼查詢,顯示的都是 127.0.0.53 迴環地址。說明ubuntu核心對dns伺服器做了一層代理;但是我內部的機制不是很明白。所以今天進行簡要了解一下,填一下年前遺留的一個坑。