站点图标 Linux-技术共享

利用VPS搭建DNS解锁机解锁Netflix等流媒体教程

QRvx54qo81k9MW6

先说原理
原理简述:使用Dnsmasq的DNS将网站解析劫持到SNI proxy反向代理的页面上。用途:让无法观看流媒体的VPS可以观看(前提:VPS中要有一个是能观看流媒体的)。
例如:a服务器不能看Netflix,但B服务器可以看Netflix,这时,你可以把B服务器搭建成Netflix解锁服务器,让A服务器或者更多服务器也能通过B服务器看Netflix。这样,你一台解锁的服务器就能和小伙伴分享了,大家平摊B服务器的费用也是极好的,因此你这个B服务器的解锁,需要你的授权,这样才能确保不被滥用。

解锁服务器搭建脚本
1号脚本dnsmasq_sniproxy_install:国人开发,实现最基础的解锁功能,但在控制用户授权方面不是很方便。具体教程https://ybfl.xyz/73.html
项目地址 https://github.com/myxuchangbin/dnsmasq_sniproxy_install
脚本

wget --no-check-certificate -O dnsmasq_sniproxy.sh https://raw.githubusercontent.com/myxuchangbin/dnsmasq_sniproxy_install/master/dnsmasq_sniproxy.sh && bash dnsmasq_sniproxy.sh -f
2号脚本netflix-proxy,外国人开发,有一定搭建难度,需要dd系统,但后期管理授权方便。
项目地址 https://github.com/ab77/netflix-proxy

重装解锁Netflix服务器的系统,选Ubuntu_20.04

wget --no-check-certificate -qO ~/Network-Reinstall-System-Modify.sh 'https://www.cxthhhhh.com/CXT-Library/Network-Reinstall-System-Modify/Network-Reinstall-System-Modify.sh' && chmod a+x ~/Network-Reinstall-System-Modify.sh && bash ~/Network-Reinstall-System-Modify.sh -UI_Options
系统默认用户名是:root,默认密码是:cxthhhhh.com

安装脚本

apt-get update\
&& apt-get -y install vim dnsutils curl sudo\
&& curl -fsSL https://get.docker.com/ | sh || apt-get -y install docker.io\
&& mkdir -p ~/netflix-proxy\
&& cd ~/netflix-proxy\
&& curl -fsSL https://github.com/ab77/netflix-proxy/archive/latest.tar.gz | gunzip - | tar x --strip-components=1\
&& ./build.sh
改密码
服务器自动生成的密码很难记,而作者提供的改密码的方式有问题,这里提供大佬的方式

#进入文件目录
cd ~/netflix-proxy/auth/
# 进入数据库
sqlite3 ./db/auth.db
#修改密码
update users set password='你的新密码' where id=1;
A服务器的dns设置
如果是七合一脚本搭建的环境,建议直接用脚本自带的dns添加即可

wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
如果不是,可使用以下命令执行。

echo 'nameserver 解锁服务器的IP' > /etc/resolv.conf
检测是否解锁

bash <(curl -sSL https://raw.githubusercontent.com/Netflixxp/NF/main/nf.sh)
绝命毒师地址
https://www.netflix.com/title/70143836

最后
记得安装bbr加速

wget -N --no-check-certificate "https://github.000060000.xyz/tcp.sh" && chmod +x tcp.sh && ./tcp.sh


或者以下是另一份教材

假如你有两台服务器,A和B。
A速度很快,但是不能观看Netflix,B你使用起来很慢却可以观看Netflix,而从A访问B却很快,那么如何用A服务器的速度去用B访问Netflix呢?

服务器B安装Dnsmasq & Sniproxy
在支持Netflix的B服务器上面安装Dnsmasq & Sniproxy
需要占用B服务器80和53端口

快速安装(推荐):
wget --no-check-certificate -O dnsmasq_sniproxy.sh https://raw.githubusercontent.com/myxuchangbin/dnsmasq_sniproxy_install/master/dnsmasq_sniproxy.sh && bash dnsmasq_sniproxy.sh -f
普通安装:
wget --no-check-certificate -O dnsmasq_sniproxy.sh https://raw.githubusercontent.com/myxuchangbin/dnsmasq_sniproxy_install/master/dnsmasq_sniproxy.sh && bash dnsmasq_sniproxy.sh -i
卸载方法:
wget --no-check-certificate -O dnsmasq_sniproxy.sh https://raw.githubusercontent.com/myxuchangbin/dnsmasq_sniproxy_install/master/dnsmasq_sniproxy.sh && bash dnsmasq_sniproxy.sh -u
修改服务器A的DNS
安装完成后在A服务器上添加DNS地址为B服务器的IP地址

vim /etc/resolv.conf
打开配置文件添加在第一行

nameserver x.x.x.x #这里为B服务器的IP地址
nameserver 8.8.8.8 #这是原来的DNS地址 不用修改
修改完成后:wq回车保存

检查A服务器Netflix服务
用nslook查看A服务器解析Netflix是否为B服务器的IP地址

nslookup Netflix.com
如果命令不存在则先安装:
Debian:

apt-get -y install dnsutils
Centos:

yum install -y bind-utils
再执行

nslookup Netflix.com
没问题的话现在就可以用A服务器访问Netflix了

访问限制
为了防止DNS被其他人滥用我们需要限制访问B服务器53端口
使用iptables

先限制所有IP访问53端口

iptables -I INPUT -p tcp --dport 53 -j DROP
再允许单个IP访问

iptables -I INPUT -s x.x.x.x -p tcp --dport 53 -j ACCEPT
要允许多个IP则添加多条即可

 

退出移动版