/etx//.conf是下DNS解析服务配置文件 , 为下 and 配置目录
step 1——修改.conf参数
管理员权限打开 //.conf
sudo nano /etc/systemd/resolved.conf
修改如下:
【ubuntu22】#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.netDNS=1.1.1.1 FallbackDNS=9.9.9.9#Domains=DNSSEC=allow-downgradeDNSOverTLS=opportunistic#MulticastDNS=no#LLMNR=noCache=no-negative#CacheFromLocalhost=noDNSStubListener=yes#DNSStubListenerExtra=ReadEtcHosts=yes#ResolveUnicastSingleLabel=no
参数的具体含义见
step2——重启DNS服务
systemctl restart systemd-resolved #重置DNS服务systemctl enable systemd-resolved#开机自启动
为DNS指令 , 查看状态用参数
——系统调用库&的解析
为解析服务调用 , 只有查看状态和重置参数命令 , 用的库可以实现
文章插图
为系统调用 ,
依次有元命令 ,
元文件命令
机器命令——展示机器指令
作业命令——作业 , 取消作业
check , 环境变量
系统和服务 管理指令——对 的配置与执行
系统(调用)命令
文章插图
step3——小时牛刀
为了更高效地工作 , 请务必运行以下命令 ~~
服务的操作
启动服务: start .
关闭服务: stop .
重启服务:.
显示服务的状态:.
在开机时启用服务:.
在开机时禁用服务:.
查看服务是否开机启动: is- .
查看已启动的服务列表: list-unit-files|grep
查看启动失败的服务列表: --