“Debian 域名打不开”这句话可能有几种不同含义,我分别说明一下常见原因和解决办法。
如果是访问 https://www.debian.org 无法打开:
# 测试网络
ping -c 4 debian.org
# 测试 DNS
nslookup debian.org
# 尝试 IPv4
ping -4 debian.org
如果 DNS 失败,可改用公共 DNS:
8.8.8.8
1.1.1.1
223.5.5.5
例如:
systemctl status nginx
systemctl status apache2
ufw status
cat /etc/hosts
这是最常见的情况之一。
Failed to fetch http://deb.debian.org/debian/
sudo nano /etc/apt/sources.list
改为(例如清华源):
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main
然后:
sudo apt update
Debian 默认不一定支持:
apt install avahi-daemon
为了更准确帮你,请告诉我:
cat /etc/os-release)我可以一步步帮你定位。