天津風
[筆記] Ubuntu Server 裝好之後的 Todo List
天津風
1. 把 systemd-reslove 幹掉
硬幹:不推薦(容易起死復活)
sudo systemctl disable --now systemd-resolved.service
sudo systemctl disable --now resolvconf.service
sudo rm /etc/resolv.conf
sudo touch /etc/resolv.conf
echo "nameserver 1.1.1.1" | sudo tee /etc/resolv.conf
天津風
2. 把 snap 幹掉
sudo systemctl stop snapd
sudo apt remove --purge -y snapd
rm -rf ~/snap/
sudo rm -rf /var/cache/snapd/
How to remove snapd from Ubuntu
天津風
上面硬幹做法好像有機會讓他復活,下面方法比較和平 (?
sudo mkdir -p /etc/systemd/resolved.conf.d/
sudo touch /etc/systemd/resolved.conf.d/disable-stub.conf
printf "[Resolve]\nDNSStubListener=no\n" | sudo tee /etc/systemd/resolved.conf.d/disable-stub.conf
Gea-Suan Lin
不確定你的 server 是什麼樣的 server (像是 HiNet PPPoE 或是 VPS),我會建議關掉 systemd-resolved 後裝 resolvconf,蠻多程式 (像是 VPN 類的程式) 應該都有支援跟 resolvconf 配合...
天津風
Gea-Suan Lin : 我的 Server 主要是 PromoxVE 上的 VM 外面有防火牆
resolvconf 目前是永不都太到,主要還是避免 systemd-resolved 只寫一個 nameserver 127.0.0.1 的 /etc/resolve.conf 然後爆炸
天津風
Disable systemd-resolved Cleanly
2022/08/07 紀錄,用這個方法關掉之後,不曉得是系統更新還是怎樣,他又回來了
載入新的回覆