ubuntu netplan使用静态ip 设置dns,dns不生效

ubuntu 使用静态ip时,通过netplan设置DNS,而查看DNS时发现DNS并没生效,其原因是系统指向的问题。

1 删除原resolv.conf,
    rm -rf /etc/resolv.conf
2 创建软连接
    ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

你可能感兴趣的:(ubuntu,tcp/ip,linux)