1.輸入該命令按回車(chē)鍵:vi /etc/systemd/resolved.conf
2.按i進(jìn)入插入模式,修改為例如DNS=8.8.8.8 223.5.5.5,然后按ESC鍵輸入wq按回車(chē)鍵保存退出vi編輯
3.輸入該命令按回車(chē)鍵:systemctl restart systemd-resolved
4.輸入該命令按回車(chē)鍵:systemctl enable systemd-resolved
5.輸入該命令按回車(chē)鍵:mv /etc/resolv.conf /etc/resolv.conf.bak
6.輸入該命令按回車(chē)鍵:ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
7.輸入該命令按回車(chē)鍵查看設(shè)置情況,重啟服務(wù)驗(yàn)證:cat /etc/resolv.conf