ubuntu22.04 DNSSEC(暗号化DNSサービス)構成

/etx/systemd/resolved.conf は、ubuntu の DNS 解決サービス構成ファイルです。systemd は、ubuntu のシステムおよびサービス構成ディレクトリです。

ステップ 1—resolved.conf パラメータを変更する

管理者権限で /systemd/resolved.conf を開きます

sudo nano /etc/systemd/resolved.conf

次のように変更します。

#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it under the
#  terms of the GNU Lesser General Public License as published by the Free
#  Software Foundation; either version 2.1 of the License, or (at your option)
#  any later version.
#
# Entries in this file show the compile time defaults. Local configuration
# should be created by either modifying this file, or by creating "drop-ins" in
# the resolved.conf.d/ subdirectory. The latter is generally recommended.
# Defaults can be restored by simply deleting this file and all drop-ins.
#
# Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config.
#
# See resolved.conf(5) for details.

[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com
# Google:     8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google
# Quad9:      9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net
DNS=1.1.1.1 
FallbackDNS=9.9.9.9
#Domains=
DNSSEC=allow-downgrade
DNSOverTLS=opportunistic
#MulticastDNS=no
#LLMNR=no
Cache=no-negative
#CacheFromLocalhost=no
DNSStubListener=yes
#DNSStubListenerExtra=
ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no

パラメータの具体的な意味については、ubuntu のマニュアルを参照してください。

ステップ2—DNSサービスを再起動します

systemctl restart systemd-resolved #重置DNS服务
systemctl enable systemd-resolved 	#开机自启动

solvectl は DNS コマンドです。ステータスを表示するには status パラメータを使用します。
ここに画像の説明を挿入

Brief1—ubuntu システムコールライブラリsolvectl&systemctlの分析

分析サービスのためにresolvectlが呼び出されますが、ステータスの表示とパラメータのリセットのコマンドのみがPythonライブラリで実現できます。

ここに画像の説明を挿入
systemctl はシステムコールであり、
メタコマンドとここに画像の説明を挿入メタファイル
ここに画像の説明を挿入
コマンドが順に存在します マシンコマンド—マシンコマンドの表示
ここに画像の説明を挿入
ジョブコマンド—ジョブの表示、ジョブ
ここに画像の説明を挿入
チェックのキャンセル、環境変数の変更システムおよびサービス管理コマンド— -
ここに画像の説明を挿入
システム マネージャ (呼び出し) コマンド用に
ここに画像の説明を挿入
システムを構成および実行します

ここに画像の説明を挿入

step3——時間チョッパー

ここに画像の説明を挿入
より効率的に作業するために、必ず次のコマンドを実行してください~~

ここに画像の説明を挿入

サービスの運営

サービスを開始します: systemctl start vsftpd.service

サービスを閉じます: systemctl stop vsftpd.service

サービスを再起動します: systemctl restart vsftpd.service

サービスのステータスを表示します: systemctl status vsftpd.service

起動時にサービスを有効にします: systemctl enable vsftpd.service

起動時にサービスを無効にします: systemctl disable vsftpd.service

サービスが開始されているかどうかを確認します: systemctl is-enabled vsftpd.service

開始されたサービスのリストを表示します: systemctl list-unit-files|grep が有効になっています

起動に失敗したサービスのリストを表示します: systemctl --failed

おすすめ

転載: blog.csdn.net/shuia64649495/article/details/132003388