From 50ab8d2bd165587173b3853fe5e4155e3299315e Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 15 Jul 2023 23:39:45 +0800 Subject: [PATCH] =?UTF-8?q?ubuntu:=20=E6=B7=BB=E5=8A=A0=20dig=20=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user-data | 1 + 1 file changed, 1 insertion(+) diff --git a/user-data b/user-data index 1a7ca76..8e485c1 100644 --- a/user-data +++ b/user-data @@ -27,6 +27,7 @@ autoinstall: # 禁用 DNS 强制离线安装内核和跳过最后的更新 # 但安装器会配置时区和写入最近的mirror到/etc/apt/sources.list 所以要提前解析 + # dig会显示cname结果,cname会以.结尾,grep -v '\.$' 表示去除 cname 结果 echo $(dig +short geoip.ubuntu.com | grep -v '\.$' | head -1) geoip.ubuntu.com >>/etc/hosts sed -i -E 's/(^nameserver )/#\1/' /etc/resolv.conf late-commands: