
























# Debian/Ubuntu
apt-get install knot-dnsutils
# CentOS/RHEL
dnf install bind-utils
下面以 frytea.com 为例,使用 dig 命令获取 frytea.com 的 IP 地址,然后添加路由规则。以下是具体步骤:
# 假设 dig 获取到的 IP 是 1.2.3.4,则运行:
ip route add 1.2.3.4/32 via 192.168.25.18
如果你想要一个自动化的脚本来完成这个任务,可以使用以下命令:
for ip in $(dig frytea.com +short | grep -E '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'); do
ip route add ${ip}/32 via 192.168.25.18
done
这个命令会:
注意:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。