Netflix 流媒体反代方案
2023年5月22日...大约 4 分钟
说明
方案基于dnsmasq 搭配 sniproxy 实现,不需要使用梯子即可进行访问Netflix,disney 等
注意
sniproxy 也是代理机器 ,所以网速也会出现不稳定的情况
1、登录 sniproxy 网站,获取自己需要的服务器地址

2、查找 dnsmasq 的配置文件,以 istoreos 为例
查看进程
netstat过滤
#
#直接过滤 dnsmasq 也是一种办法
#
root@iStoreOS:~# netstat -tunlp | grep dnsmasq
tcp 0 0 172.17.0.1:53 0.0.0.0:* LISTEN 8156/dnsmasq
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 8156/dnsmasq
tcp 0 0 192.168.1.50:53 0.0.0.0:* LISTEN 8156/dnsmasq
tcp 0 0 fd58:b84a:86aa::1:53 :::* LISTEN 8156/dnsmasq
tcp 0 0 fe80::20c:29ff:fe1a:a2b0:53 :::* LISTEN 8156/dnsmasq
tcp 0 0 ::1:53 :::* LISTEN 8156/dnsmasq
udp 0 0 172.17.0.1:53 0.0.0.0:* 8156/dnsmasq
udp 0 0 127.0.0.1:53 0.0.0.0:* 8156/dnsmasq
udp 0 0 192.168.1.50:53 0.0.0.0:* 8156/dnsmasq
udp 0 0 fd58:b84a:86aa::1:53 :::* 8156/dnsmasq
udp 0 0 fe80::20c:29ff:fe1a:a2b0:53 :::* 8156/dnsmasq
udp 0 0 ::1:53 :::* 8156/dnsmasq
ps 过滤 pid
root@iStoreOS:~# ps | grep 8156
8156 dnsmasq 2524 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.cfg01411c.pid
20327 root 1124 R grep 8156
可以看到 /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf.cfg01411c -k -x /var/run/dnsmasq/dnsmasq.
dnsmqsq 的配置文件是 /var/etc/dnsmasq.conf.cfg01411c
接着查看这个配置文件
查看 dnsmasq 运行配置文件
root@iStoreOS:~# cat /var/etc/dnsmasq.conf.cfg01411c | grep conf-file
conf-file=/etc/dnsmasq.conf
conf-file=/usr/share/dnsmasq/dhcpbogushostname.conf
conf-file=/usr/share/dnsmasq/rfc6761.conf
可以看到,默认加载 3个配置文件,推荐修改 /etc/dnsmasq.conf
查看一下 /etc/dnsmasq.conf
的中配置
配置内容
root@iStoreOS:~# cat /etc/dnsmasq.conf
# Change the following lines if you want dnsmasq to serve SRV
# records.
# You may add multiple srv-host lines.
# The fields are <name>,<target>,<port>,<priority>,<weight>
# A SRV record sending LDAP for the example.com domain to
# ldapserver.example.com port 289
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389
# Two SRV records for LDAP, each with different priorities
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,1
#srv-host=_ldap._tcp.example.com,ldapserver.example.com,389,2
# A SRV record indicating that there is no LDAP server for the domain
# example.com
#srv-host=_ldap._tcp.example.com
# The following line shows how to make dnsmasq serve an arbitrary PTR
# record. This is useful for DNS-SD.
# The fields are <name>,<target>
#ptr-record=_http._tcp.dns-sd-services,"New Employee Page._http._tcp.dns-sd-services"
# Change the following lines to enable dnsmasq to serve TXT records.
# These are used for things like SPF and zeroconf.
# The fields are <name>,<text>,<text>...
#Example SPF.
#txt-record=example.com,"v=spf1 a -all"
#Example zeroconf
#txt-record=_http._tcp.example.com,name=value,paper=A4
# Provide an alias for a "local" DNS name. Note that this _only_ works
# for targets which are names from DHCP or /etc/hosts. Give host
# "bert" another name, bertrand
# The fields are <cname>,<target>
#cname=bertand,bert
dnsmasq 增加以下配置,根据个人情况进行增、减 , 修改 /etc/dnsmasq.conf
,
提示
每次修改完都需要重启 dnsmasq
- openwrt 在dnsmasq配置页面随便修改一个配置,保存应用即可。
- 手动安装的则需要用命令重启相关服务
dnsmasq 配置
dnsmasq.conf
address=/akadns.net/ 38.150.13.141
address=/akam.net/ 38.150.13.141
address=/akamai.com/ 38.150.13.141
address=/akamai.net/ 38.150.13.141
address=/akamaiedge.net/ 38.150.13.141
address=/akamaihd.net/ 38.150.13.141
address=/akamaistream.net/ 38.150.13.141
address=/akamaitech.net/ 38.150.13.141
address=/akamaitechnologies.com/ 38.150.13.141
address=/akamaitechnologies.fr/ 38.150.13.141
address=/akamaized.net/ 38.150.13.141
address=/edgekey.net/ 38.150.13.141
address=/edgesuite.net/ 38.150.13.141
address=/srip.net/ 38.150.13.141
address=/footprint.net/ 38.150.13.141
address=/level3.net/ 38.150.13.141
address=/llnwd.net/ 38.150.13.141
address=/edgecastcdn.net/ 38.150.13.141
address=/cloudfront.net/ 38.150.13.141
address=/netflix.com/ 38.150.13.141
address=/netflix.net/ 38.150.13.141
address=/nflximg.com/ 38.150.13.141
address=/nflximg.net/ 38.150.13.141
address=/nflxvideo.net/ 38.150.13.141
address=/nflxso.net/ 38.150.13.141
address=/nflxext.com/ 38.150.13.141
address=/hulu.com/ 38.150.13.141
address=/huluim.com/ 38.150.13.141
address=/hbonow.com/ 38.150.13.141
address=/hbogo.com/ 38.150.13.141
address=/hbo.com/ 38.150.13.141
address=/amazon.com/ 38.150.13.141
address=/amazon.co.uk/ 38.150.13.141
address=/amazonvideo.com/ 38.150.13.141
address=/crackle.com/ 38.150.13.141
address=/pandora.com/ 38.150.13.141
address=/vudu.com/ 38.150.13.141
address=/blinkbox.com/ 38.150.13.141
address=/abc.com/ 38.150.13.141
address=/fox.com/ 38.150.13.141
address=/theplatform.com/ 38.150.13.141
address=/nbc.com/ 38.150.13.141
address=/nbcuni.com/ 38.150.13.141
address=/ip2location.com/ 38.150.13.141
address=/pbs.org/ 38.150.13.141
address=/warnerbros.com/ 38.150.13.141
address=/southpark.cc.com/ 38.150.13.141
address=/cbs.com/ 38.150.13.141
address=/brightcove.com/ 38.150.13.141
address=/cwtv.com/ 38.150.13.141
address=/spike.com/ 38.150.13.141
address=/go.com/ 38.150.13.141
address=/mtv.com/ 38.150.13.141
address=/mtvnservices.com/ 38.150.13.141
address=/playstation.net/ 38.150.13.141
address=/uplynk.com/ 38.150.13.141
address=/maxmind.com/ 38.150.13.141
address=/disney.com/ 38.150.13.141
address=/disneyjunior.com/ 38.150.13.141
address=/adobedtm.com/ 38.150.13.141
address=/bam.nr-data.net/ 38.150.13.141
address=/bamgrid.com/ 38.150.13.141
address=/braze.com/ 38.150.13.141
address=/cdn.optimizely.com/ 38.150.13.141
address=/cdn.registerdisney.go.com/ 38.150.13.141
address=/cws.conviva.com/ 38.150.13.141
address=/d9.flashtalking.com/ 38.150.13.141
address=/disney-plus.net/ 38.150.13.141
address=/disney-portal.my.onetrust.com/ 38.150.13.141
address=/disney.demdex.net/ 38.150.13.141
address=/disney.my.sentry.io/ 38.150.13.141
address=/disneyplus.bn5x.net/ 38.150.13.141
address=/disneyplus.com/ 38.150.13.141
address=/disneyplus.com.ssl.sc.omtrdc.net/ 38.150.13.141
address=/disneystreaming.com/ 38.150.13.141
address=/dssott.com/ 38.150.13.141
address=/execute-api.us-east-1.amazonaws.com/ 38.150.13.141
address=/js-agent.newrelic.com/ 38.150.13.141
address=/xboxlive.com/ 38.150.13.141
address=/lovefilm.com/ 38.150.13.141
address=/turner.com/ 38.150.13.141
address=/amctv.com/ 38.150.13.141
address=/sho.com/ 38.150.13.141
address=/mog.com/ 38.150.13.141
address=/wdtvlive.com/ 38.150.13.141
address=/beinsportsconnect.tv/ 38.150.13.141
address=/beinsportsconnect.net/ 38.150.13.141
address=/fig.bbc.co.uk/ 38.150.13.141
address=/open.live.bbc.co.uk/ 38.150.13.141
address=/sa.bbc.co.uk/ 38.150.13.141
address=/www.bbc.co.uk/ 38.150.13.141
address=/crunchyroll.com/ 38.150.13.141
address=/ifconfig.co/ 38.150.13.141
address=/omtrdc.net/ 38.150.13.141
address=/sling.com/ 38.150.13.141
address=/movetv.com/ 38.150.13.141
address=/happyon.jp/ 38.150.13.141
address=/abema.tv/ 38.150.13.141
address=/hulu.jp/ 38.150.13.141
address=/optus.com.au/ 38.150.13.141
address=/optusnet.com.au/ 38.150.13.141
address=/gamer.com.tw/ 38.150.13.141
address=/bahamut.com.tw/ 38.150.13.141
address=/hinet.net/ 38.150.13.141
address=/dmm.com/ 38.150.13.141
address=/dmm.co.jp/ 38.150.13.141
address=/dmm-extension.com/ 38.150.13.141
address=/dmmapis.com/ 38.150.13.141
address=/api-p.videomarket.jp/ 38.150.13.141
address=/saima.zlzd.xyz/ 38.150.13.141
address=/challenges.cloudflare.com/ 38.150.13.141
address=/ai.com/ 38.150.13.141
address=/openai.com/ 38.150.13.141
address=/fast.com// 38.150.13.141
批量修改IP
#例如把 38.150.13.141 换成 43.159.11.48
sed -i 's#38.150.13.141#43.159.11.48#g' /etc/dnsmasq.conf
# 然后重启 dnsmasq
3、尽情享受吧
把电脑、电视、手机等dns 指定到这个IP即可,通常op 上都会有 dnsmasq ,把dns 放到 dhcp 下发下去即可,这样无需人工配置。
没有openwrt的:
- Windows电脑可以参考:Acrylic + sniproxy 配置参考
- 有Linux的可以找 dnsmasq 的配置文档,然后参考这个本文增加相关配置,或者使用网上的一键脚本
贡献者
changelichangyangccm@163.com