| 服务名称 | NTP | systemd-timesyncd | Chrony |
| 协议名称 | NTP | SNTP | NTP |
| 特点 | 高精度 | 轻量级 | 快速同步 |
| 适用建议 | 数据中心、科研机构 | 桌面电脑、小型服务器 | 不稳定的网络环境 |
[内容] Linux SSL 证书公钥的转换
# openssl pkcs7 -print_certs -in eternalcenter.p7b -out eternalcenter.crt
(补充:这里以将 SSL 证书公钥 eternalcenter.p7b 转换为 SSL 证书公钥 eternalcenter.crt 为例)
[内容] SAMBA 远程共享目录临时挂载参数的案例
# mount -t cifs -o user=Linux,password=eternalcenter '//10.0.0.254/Linux' '/Linux'
或者:
# mount -t cifs -o username=Linux,password=eternalcenter '//10.0.0.254/Linux' '/Linux'
(补充:这里以通过用户 Linux 密码为 password,挂载 IP 地址 10.0.0.254 的 Samba 共享目录 /Linux 到本地的 /Linux 目录为例)
[步骤] dnsmasq 的搭建 (DNS 服务)
步骤一:安装 dnsmasq
# yum install dnsmasq
步骤二:添加 DNS 配置
# vi /etc/dnsmasq.d/address.conf
创建以下内容:
all-servers
server=1.1.1.1
server=8.8.8.8
server=/cn/114.114.114.114
address=/test-gateway.com/192.168.100.1
host-record=gateway.com,192.168.100.1
(
补充:
1) 这里的 all-servers 代表同时解析下面所有的 DNS 记录
2) 这里的 server=1.1.1.1 和 server=8.8.8.8 代表上游 DNS 服务器使用 1.1.1.1 和 8.8.8.8
3) 这里的 server=/cn/114.114.114.114 代表以 cn 结尾的域名上游 DNS 使用 114.114.114.114
4) 这里的 address=/test-gateway.com/192.168.100.1 代表所有以 test-gateway.com 结尾的域名 (例如 one.test-gateway.com) 指向 IP 地址 192.168.100.1
5) 这里的 host-record=gateway.com,192.168.100.1 代表 gateway.com 域名指向 IP 地址 192.168.100.1
)
步骤三:重启 dnsmasq 服务
3.1 重启 dnsmasq 服务
# systemctl restart dnsmasq.service
3.2 查看 dnsmasq 服务状态
# systemctl status dnsmasq.service
● dnsmasq.service - DNS caching server.
Loaded: loaded (/usr/lib/systemd/system/dnsmasq.service; disabled; vendor preset: disabled)
Active: active (running) since Thu 2025-08-14 00:00:35 CST; 7s ago
Main PID: 10412 (dnsmasq)
Tasks: 1 (limit: 5781)
Memory: 704.0K
CGroup: /system.slice/dnsmasq.service
└─10412 /usr/sbin/dnsmasq -k
Aug 14 00:00:35 tool1 dnsmasq[10412]: compile time options: IPv6 GNU-getopt DBus no-i18n IDN2 DHCP>
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 114.114.114.114#53 for domain cn
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 8.8.8.8#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 1.1.1.1#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: reading /etc/resolv.conf
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 114.114.114.114#53 for domain cn
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 8.8.8.8#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: using nameserver 1.1.1.1#53
Aug 14 00:00:35 tool1 dnsmasq[10412]: ignoring nameserver 192.168.100.11 - local interface
Aug 14 00:00:35 tool1 dnsmasq[10412]: read /etc/hosts - 2 addresses
步骤四:使用配置好的 dnsmasq 服务
# vi /etc/resolv.conf
将全部内容修改如下:
nameserver 192.168.100.11
(补充:这里的 192.168.100.11 指的是刚刚搭建 dnsmasq 服务的服务器的 IP 地址)
步骤五:测试 dnsmasq 服务
5.1 测试 DNS 正向解析
# nslookup test-gateway.com
Server: 192.168.100.11
Address: 192.168.100.11#53
Name: test-gateway.com
Address: 192.168.100.1
(补充:这里以正向解析刚刚配置的域名 test-gateway.com 为例)
5.2 测试 DNS 反向解析
# arp 192.168.100.1
Address HWtype HWaddress Flags Mask Iface
_gateway ether 52:54:00:ef:3a:4d C eth0
(补充:这里以反向解析刚刚配置的 IP 地址 192.168.100.1 为例)
[步骤] Apache 的安装
如果是 Rocky Linux & RHEL
# yum install apache2
如果是 openSUSE & SLES
# zypper install apache2
