Qingquan-Li / blog

My Blog
https://Qingquan-Li.github.io/blog/
132 stars 16 forks source link

配置网站的IP地址到hosts中 #136

Open Qingquan-Li opened 4 years ago

Qingquan-Li commented 4 years ago

应用场景:网站原来的 IP 地址无效或被封了。

实例:配置网址 github.com 的 IP 地址到本机的 hosts 文件中。

# 查看网址 github.com 当前的 IP 地址
$ nslookup github.com
Server:     8.8.8.8
Address:    8.8.8.8#53

Non-authoritative answer:
Name:   github.com
Address: 13.250.177.223

https://github.com.ipaddress.com 中查看到 github.com 的 IPv4 Addresses 为 140.82.114.4 ,将其配置在本机的 hosts 文件中:

$ sudo vim /etc/hosts
# 添加:140.82.114.4   github.com