国内中转机下载github源码失效 443连接失败等问题;须更改hosts文件

1:首先可以前往 查询最快的IP地址
2:然后利用echo写入查询到的最快IP和并把IP根据对应的域名替换如下echo命令中并运行
如:

echo "151.101.76.133 raw.githubusercontent.com" >> /etc/hosts
echo "151.101.76.133 github.com" >> /etc/hosts

2:下载brook-pf-mod.sh

wget -N --no-check-certificate https://raw.githubusercontent.com/siemenstutorials/brookddns/master/brook-pf-mod.sh

3:创建/usr/local/brook-pf目录,切换至该目录并清空里面的文件

mkdir /usr/local/brook-pf;cd /usr/local/brook-pf;rm -rf /usr/local/brook-pf/*

4:下载brook最新版本文件,并重命名为brook

wget -N --no-check-certificate "https://github.com/txthinking/brook/releases/download/v20200801/brook_linux_arm64";chmod +x brook_linux_arm64 ; mv brook_linux_arm64 brook

5:创建配置文件,brook.conf

echo >  /usr/local/brook-pf/brook.conf

6:根据系统下载管理脚本

#centos:
wget https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/brook-pf_centos -O /etc/init.d/brook-pf;chmod +x /etc/init.d/brook-pf;chkconfig --add brook-pf;chkconfig brook-pf on
#debian:
https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/brook-pf_debian -O /etc/init.d/brook-pf;chmod +x /etc/init.d/brook-pf;update-rc.d -f brook-pf defaults

7:返回目录运行brook即可

cd ~;chmod +x brook-pf-mod.sh;./brook-pf-mod.sh

开启DDNS

#centos:
yum install bind-utils -y
#debian:
apt-get install dnsutils

之后调用

./brook-pf-mod.sh
如果觉得我的文章对你有用,请随意赞赏