RESOLVED.CONF(5) | resolved.conf | RESOLVED.CONF(5) |
NAME¶
resolved.conf, resolved.conf.d - 網絡名字解析服務配置文件
SYNOPSIS¶
/etc/systemd/resolved.conf
/etc/systemd/resolved.conf.d/*.conf
/run/systemd/resolved.conf.d/*.conf
/usr/lib/systemd/resolved.conf.d/*.conf
描述¶
這些配置文件控制着本地DNS與LLMNR名字解析
配置目錄及其優先級¶
默認設置是在編譯期間確定的, 所以僅在確實需要修改默認設置的情況下, 才需要使用配置文件。位於 /etc/systemd/ 目錄中的初始配置文件, 僅包含了展示選項默認值的註釋, 目的在於方便系統管理員查看和直接修改。
如果軟件包想要自定義某些默認設置, 那麼必須將自定義的配置文件安裝到 /usr/lib/systemd/*.conf.d/ 目錄中。 /etc/ 目錄僅供系統管理員使用。 系統管理員可以利用下面的邏輯來覆蓋默認設置: 主配置文件最先被讀取, 優先級也最低。 所有 *.conf.d/ 中的配置文件 都會覆蓋主配置文件中的設置。 所有 *.conf.d/ 中的配置文件(無論位於哪個目錄中), 統一按照文件名的字典順序處理。 如果在多個配置文件中設置了同一個選項, 那麼僅以文件名最靠後(字典順序)的那一個爲準。 爲了便於排序, 建議給所有 *.conf.d/ 中的配置文件 都加上兩位十進制數字的文件名前綴。
如果系統管理員想要屏蔽 /usr/lib/ 目錄中的某個配置文件, 那麼最佳做法是在 /etc/ 目錄中 創建一個指向 /dev/null 的同名符號鏈接, 即可徹底屏蔽 /usr/lib/ 目錄中的同名文件。
選項¶
下列選項都位於 "[Resolve]" 小節:
DNS=
FallbackDNS=
Domains=
如果指定的域名帶有 "~" 前綴, 那麼表示它不是一個搜索域,而是一個"路由專用域名",也就是僅用於將指定的域名查詢請求 優先路由到上文 DNS= 設置的全局DNS服務器上去。 注意,如果不存在針對特定連接的DNS服務器,那麼 "~" 語法沒有任何實際效果。 特殊值 "~." 表示將所有DNS查詢請求 優先路由到上文 DNS= 設置的全局DNS服務器上去 (前面的波浪號表示這是一個"路由專用域名",後面的點表示DNS根域名(也就是所有域名的後綴))。
LLMNR=
DNSSEC=
注意,因爲 DNSSEC 需要額外查詢更多的DNS數據, 所以,開啓此選項會減慢DNS查詢速度。
DNSSEC requires knowledge of "trust anchors" to prove data integrity. The trust anchor for the Internet root domain is built into the resolver, additional trust anchors may be defined with dnssec-trust-anchors.d(5). Trust anchors may change at regular intervals, and old trust anchors may be revoked. In such a case DNSSEC validation is not possible until new trust anchors are configured locally or the resolver software package is updated with the new root trust anchor. In effect, when the built-in trust anchor is revoked and DNSSEC= is yes, all further lookups will fail, as it cannot be proved anymore whether lookups are correctly signed, or validly unsigned. If DNSSEC= is set to "allow-downgrade" the resolver will automatically turn off DNSSEC validation in such a case.
Client programs looking up DNS data will be informed whether lookups could be verified using DNSSEC, or whether the returned data could not be verified (either because the data was found unsigned in the DNS, or the DNS server did not support DNSSEC or no appropriate trust anchors were known). In the latter case it is assumed that client programs employ a secondary scheme to validate the returned DNS data, should this be required.
It is recommended to set DNSSEC= to yes on systems where it is known that the DNS server supports DNSSEC correctly, and where software or trust anchor updates happen regularly. On other systems it is recommended to set DNSSEC= to "allow-downgrade".
In addition to this global DNSSEC setting systemd-networkd.service(8) also maintains per-link DNSSEC settings. For system DNS servers (see above), only the global DNSSEC setting is in effect. For per-link DNS servers the per-link setting is in effect, unless it is unset in which case the global setting is used instead.
Site-private DNS zones generally conflict with DNSSEC operation, unless a negative (if the private zone is not signed) or positive (if the private zone is signed) trust anchor is configured for them. If "allow-downgrade" mode is selected, it is attempted to detect site-private DNS zones using top-level domains (TLDs) that are not known by the DNS root server. This logic does not work in all private zone setups.
默認值是 no
Cache=
注意,對於IP地址爲 127.0.0.1 或 ::1 之類的本機DNS來說,DNS緩存總是關閉的。 這樣做是爲了避免不必要的多次緩存。
參見¶
systemd(1), systemd-resolved.service(8), systemd-networkd.service(8), dnssec-trust-anchors.d(5), resolv.conf(4)
NOTES¶
- 1.
- RFC 4794
跋¶
本頁面中文版由中文 man 手冊頁計劃提供。
翻譯人員:金步國
金步國作品集:http://www.jinbuguo.com
中文 man
手冊頁計劃:https://github.com/man-pages-zh/manpages-zh
systemd 231 |