如果系统中没有resolvconf:

apt install resolvconf

然后修改

echo 'nameserver 8.8.8.8' >> /etc/resolvconf/resolv.conf.d/base
resolvconf -u

即可生成/etc/resolv.conf