1、修改hosts文件,在终端输入
sudo vi /etc/hosts
在末尾加入你要添加的IP地址和域名,比如
# The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 8.8.8.8 XXXXXXXX XXXXXXXX 127.0.0.1 localhost localhost 140.82.112.4 github.com 185.199.108.153 assets-cdn.github.com 185.199.109.153 assets-cdn.github.com 185.199.110.153 assets-cdn.github.com 185.199.111.153 assets-cdn.github.com 199.232.69.194 fastly.net ~ ~ ~ ~ "/etc/hosts" 14L, 422C
(vi的基本用法是按i改成修改模式,添加完内容以后按ESC,然后按两次ZZ退出vi)
2、刷新DNS缓存
sudo systemd-resolve --flush-caches
留言评论
暂无留言