linux無(wú)法解析域名
環(huán)境:kali linux
我在用
apt autoremove git
卸載git的時(shí)候,想在安裝,結(jié)果顯示無(wú)法解析域名,害我搞了半天
ping www.baidu.com
域名不解析成ip,則是dns配置問(wèn)題。
然后修改resolv.conf配置
vim /etc/resolv.conf
nameserver 202.96.134.133
nameserver 114.114.114.114
nameserver 8.8.8.8
然后把原來(lái)的替換掉,然后記得重啟啊,應(yīng)該就可以了。
有一次我用apt-get update更新的時(shí)候,域名又不解析了
環(huán)境:小米6的nethunter,任何手機(jī)都可刷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
域名解析
那應(yīng)該不是dns配置問(wèn)題
更換更新源,但還是沒解決
,找了半天,終于找到了答案,在github找到了答案。
修改/etc/passwd
vim /etc/passwd
修改
_apt: x: 104: 3004 :: / nonexistent: / bin / false
為
_apt: x: 0: 65534 :: / nonexistent: / bin / false
就是把“104"改成"0"
這樣改成功域名解析。
————————————————
版權(quán)聲明:本文為CSDN博主「chunxque」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請(qǐng)附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/weixin_40943540/article/details/82943280
*博客內(nèi)容為網(wǎng)友個(gè)人發(fā)布,僅代表博主個(gè)人觀點(diǎn),如有侵權(quán)請(qǐng)聯(lián)系工作人員刪除。