环境:kali linux
我在用
apt autoremove git
卸载git的时候,想在安装,结果显示无法解析域名,害我搞了半天
ping www.baidu.com
域名不解析成ip,则是dns配置问题。
然后修改resolv.conf配置
vim /etc/resolv.conf
nameserver 202.96.134.133
nameserver 114.114.114.114
nameserver 8.8.8.8
然后把原来的替换掉,然后记得重启啊,应该就可以了。
有一次我用apt-get update更新的时候,域名又不解析了
环境:小米6的nethunter,任何手机都可刷kali.
Err:1 http://http.kali.org/kali kali-rolling InRelease Temporary failure resolving 'http.kali.org'
Err:2 https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch InRelease
Temporary failure resolving 'packages.microsoft.com'
Err:3 http://mirrors.ustc.edu.cn/kali kali-rolling InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'Err:4 http://mirrors.aliyun.com/kali kali-rolling InRelease
Temporary failure resolving 'mirrors.aliyun.com'
Err:5 http://mirrors.tuna.tsinghua.edu.cn/kali kali-rolling InRelease
Temporary failure resolving 'mirrors.tuna.tsinghua.edu.cn'Reading package lists... Done
W: Failed to fetch http://mirrors.ustc.edu.cn/kali/dists/kali-rolling/InRelease Temporary failure resolving 'mirrors.ustc.edu.cn'
W: Failed to fetch http://mirrors.aliyun.com/kali/dists/kali-rolling/InRelease Temporary failure resolving 'mirrors.aliyun.com'
W: Failed to fetch http://mirrors.tuna.tsinghua.edu.cn/kali/dists/kali-rolling/InRelease Temporary failu
ping www.baidu.com
域名解析
那应该不是dns配置问题
更换更新源,但还是没解决
,找了半天,终于找到了答案,在github找到了答案。
修改/etc/passwd
vim /etc/passwd
修改
_apt: x: 104: 3004 :: / nonexistent: / bin / false
为
_apt: x: 0: 65534 :: / nonexistent: / bin / false
就是把“104"改成"0"
这样改成功域名解析。