- 使用
nslookup
命令来查找域名对应的ip地址,并修改hosts文件。 - nslookup命令用于查询DNS的记录,查询域名解析是否正常,当网络出现故障时用其来诊断网络问题。
- 操作步骤总共有4步:
# 查找域名对应的ip地址
nslookup github.global.ssl.fastly.Net
nslookup github.com
# 在hosts文件末尾添加两行 ip 域名
sudo vim /etc/hosts
# 刷新DNS缓存
sudo /etc/init.d/networking restart
- 具体操作如下所示:
修改/etc/hosts文件 用git拉取GitHub上的SublimeTextTrans插件包root@sign-virtual-machine:/home/sign#
nslookup github.com
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name:github.com
Address:52.74.223.119
root@sign-virtual-machine:/home/sign#nslookup github.global.ssl.fastly.Net
Server: 127.0.1.1
Address: 127.0.1.1#53
Non-authoritative answer:
Name:github.global.ssl.fastly.Net
Address:69.171.235.64
root@sign-virtual-machine:/home/sign#vim /etc/hosts
root@sign-virtual-machine:/home/sign#/etc/init.d/networking restart
[ ok ] Restarting networking (via systemctl): networking.service.
root@sign-virtual-machine:/home/sign#
- 修改完之后更新一下DNS缓存就可以看到飞速地克隆下载啦~
网友评论