IP 配置
/etc/network/interfaces
auto eth0
iface eth0 inet static
address x.x.x.x
netmask 255.255.255.0
gateway x.x.x.x
#dns-nameservers 没有用
DNS配置
修改文件/etc/systemd/resolved.conf
DNS=8.8.8.8 8.8.4.4
重启 systemd-resolved
systemctl restart systemd-resolved
resolvectl status
systemctl enable systemd-resolved.service
如果 /etc/resolv.conf 不存在
ln -f -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
测试
# ping mirrors.tuna.tsinghua.edu.cn
PING bfdmirrors.s.tuna.tsinghua.edu.cn (101.6.15.130) 56(84) bytes of data.
64 bytes from 101.6.15.130 (101.6.15.130): icmp_seq=1 ttl=42 time=3.31 ms
64 bytes from 101.6.15.130 (101.6.15.130): icmp_seq=2 ttl=42 time=3.10 ms
标签:resolved,101.6,systemd,IP,15.130,resolv,conf
From: https://www.cnblogs.com/max27149/p/18180336