update-systemd-resolved
Cấu hình systemd-resolved để không ghi đè resolv.conf:
systemd-resolved để không ghi đè resolv.conf:Bước 1: Sửa cấu hình systemd-resolved để sử dụng DNS tĩnh:
sudo nano /etc/systemd/resolved.confBước 2: Cấu hình DNS tĩnh trong file này, ví dụ:
[Resolve]
DNS=1.1.1.1 8.8.8.8
FallbackDNS=1.0.0.1 8.8.4.4Bước 3: Tạo lại symlink /etc/resolv.conf:
/etc/resolv.conf:sudo ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.confBước 4: Khởi động lại systemd-resolved:
systemd-resolved:sudo systemctl restart systemd-resolvedBước 5: Kiểm tra lại DNS:
resolvectl statusLast updated