Skip to content

解决 Github 域名 DNS 污染问题 #8

Open
@yangruihan

Description

@yangruihan

解决 Github 域名 DNS 污染问题

问题背景

最近发现 github 的用户头像和自己文章中的图片显示不出来了,通过 Homebrew 安装也出问题了

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

网上搜索了一下,发现是 github 的一些域名的 DNS 解析被污染,导致DNS 解析过程无法通过域名取得正确的IP地址

解决方案

打开 https://www.ipaddress.com/ 输入访问不了的域名

查询之后可以获得正确的 IP 地址

image

在本机的 host 文件中添加,建议使用 SwitchHosts 方便 host 管理

199.232.68.133 raw.githubusercontent.com
199.232.68.133 user-images.githubusercontent.com
199.232.68.133 avatars2.githubusercontent.com
199.232.68.133 avatars1.githubusercontent.com

添加以上几条 host 配置,页面的图片展示就正常了,homebrew 也能装了

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions