You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何修复Kubuntu系统中失效的域名解析问题

如何修复Kubuntu系统中失效的域名解析问题

嘿,看了你的问题,这明显是新Kubuntu里systemd-resolved和传统resolvconf服务的配置没对齐导致的——你的/etc/resolv.conf指向了一个根本不存在的resolvconf生成文件,但实际系统默认用systemd-resolved来管理DNS。下面给你几个永久修复的方案,选一个适合你的就行:

方案一:让systemd-resolved直接管理resolvconf(推荐)

这是Kubuntu当前的默认推荐方式,步骤很简单:

  • 先删掉当前错误的resolv.conf链接:
    sudo rm /etc/resolv.conf
    
  • 重新创建链接,指向systemd-resolved维护的配置文件:
    sudo ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    
  • 重启systemd-resolved服务让配置生效:
    sudo systemctl restart systemd-resolved
    
  • 测试域名解析是否恢复:
    host www.ecosia.org
    

要是能正常返回IP地址,说明问题已经解决了,重启系统也不会再出现这个问题。

方案二:安装并启用传统resolvconf服务

如果你更习惯用resolvconf来管理DNS配置,也可以这么做:

  • 更新软件包列表:
    sudo apt update
    
  • 安装resolvconf包:
    sudo apt install resolvconf
    
  • 启用并启动resolvconf服务:
    sudo systemctl enable --now resolvconf.service
    

安装完成后,resolvconf会自动创建/run/resolvconf目录和对应的配置文件,网络管理器也会自动把DNS信息同步到这里,你的临时修复配置也会被保留下来。

额外小检查

  • 打开Kubuntu的网络设置,确认你的WiFi/有线连接的DNS配置是正确的(比如你之前用的192.168.2.1和fe80::1)。
  • 确保网络管理器能把这些DNS信息传递给systemd-resolved或者resolvconf,这样后续换网络也不会出问题。

备注:内容来源于stack exchange,提问作者Thiemo Kellner

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 08:18:00