ランキングに戻る

myxuchangbin/dnsmasq_sniproxy_install

Shell

One-click Install and Configure Dnsmasq and Sniproxy for CentOS/Debian/Ubuntu

dnsmasqsniproxynetflixshelldns-server
スター成長
スター
1.4k
フォーク
580
週間成長
Issue
44
5001k
2023年1月2024年3月2025年5月2026年7月
README

Dnsmasq SNIproxy One-click Install

脚本概述:

  • 原理简述:利用Dnsmasq的DNS功能,将特定网站的DNS解析重定向到SNIproxy反向代理。

  • 用途:让访问流媒体受限的VPS突破限制,前提是要有一个能流媒体的VPS。

  • 特性:脚本默认解锁Netflix Hulu HBO,如需增删流媒体域名请编辑文件/etc/dnsmasq.d/custom_netflix.conf/etc/sniproxy.conf

  • 脚本支持系统:CentOS7+, Debian9+, Ubuntu18+

    • 如果脚本最后显示的IP和实际公网IP不符,请修改一下文件/etc/sniproxy.conf中的IP地址

脚本用法:

bash dnsmasq_sniproxy.sh [-h] [-i] [-f] [-id] [-fd] [-is] [-fs] [-u] [-ud] [-us]
  -h , --help                显示帮助信息
  -i , --install             安装 Dnsmasq + SNI Proxy
  -f , --fastinstall         快速安装 Dnsmasq + SNI Proxy
  -id, --installdnsmasq      仅安装 Dnsmasq
  -fd, --installdnsmasq      快速安装 Dnsmasq
  -is, --installsniproxy     仅安装 SNI Proxy
  -fs, --fastinstallsniproxy 快速安装 SNI Proxy
  -u , --uninstall           卸载 Dnsmasq + SNI Proxy
  -ud, --undnsmasq           卸载 Dnsmasq
  -us, --unsniproxy          卸载 SNI Proxy

快速安装(推荐):

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

使用方法:

将代理主机的 DNS 地址设置为安装了 dnsmasq 的主机 IP 即可,如果遇到问题,尝试在配置文件中只保留一个 DNS 地址。

为了防止滥用,建议不要公开 IP 地址,并使用防火墙进行适当的访问限制。

调试排错:

  • 确认 sniproxy 运行状态

    查看sniproxy状态:systemctl status sniproxy

    如果 sniproxy 未运行,请检查是否有其他服务占用了 80、443 端口,导致端口冲突。可以使用 netstat -tlunp | grep 443 命令查看端口监听情况。

  • 确认防火墙设置

    确保防火墙已放行 53、80、443 端口。在调试时,可以关闭防火墙: systemctl stop firewalld.service

    对于阿里云、腾讯云、AWS 等云服务提供商,安全组的端口设置同样需要放行。

    使用其他服务器进行测试: telnet 1.2.3.4 53

  • 域名解析测试

    在配置完 DNS 后,进行域名解析测试:nslookup netflix.com 检查 IP 是否为 Netflix 代理服务器的 IP。 如果系统中没有 nslookup 命令,可以在 CentOS 上安装:yum install -y bind-utils 在 Ubuntu 和 Debian 上安装:apt-get -y install dnsutils

  • 解决 systemd-resolve 服务占用 53 端口的问题

    使用 netstat -tlunp | grep 53 发现 53 端口被 systemd-resolved 占用 修改/etc/systemd/resolved.conf文件:

    [Resolve]
    DNS=8.8.8.8 1.1.1.1 #取消注释,增加dns
    #FallbackDNS=
    #Domains=
    #LLMNR=no
    #MulticastDNS=no
    #DNSSEC=no
    #Cache=yes
    DNSStubListener=no  #取消注释,把yes改为no
    

    然后执行以下命令,并重启 systemd-resolved 服务:

    ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
    systemctl restart systemd-resolved.service
    
関連リポジトリ
pi-hole/pi-hole

A black hole for Internet advertisements

ShellOtherpi-holead-blocker
pi-hole.net
60k3.3k
Loyalsoldier/clash-rules

🦄️ 🎃 👻 Clash Premium 规则集(RULE-SET),兼容 ClashX Pro、Clash for Windows 等基于 Clash Premium 内核的客户端。

GNU General Public License v3.0clashgeosite
27.7k2.2k
Loyalsoldier/v2ray-rules-dat

🦄 🎃 👻 V2Ray 路由规则文件加强版,可代替 V2Ray 官方 geoip.dat 和 geosite.dat,适用于 V2Ray、Xray-core、mihomo(Clash-Meta)、hysteria、Trojan-Go 和 leaf。Enhanced edition of V2Ray rules dat files, applicable to V2Ray, Xray-core, mihomo(Clash-Meta), hysteria, Trojan-Go and leaf.

GNU General Public License v3.0v2raygeoip
20.3k2.7k
privacy-protection-tools/anti-AD

致力于成为中文区命中率最高的广告过滤列表,实现精确的广告屏蔽和隐私保护。anti-AD 现已支持 AdGuardHome,dnsmasq,Surge,Pi-Hole,Clash, mihomo,smartdns,sing-box 等网络组件。完全兼容常见的广告过滤工具所支持的各种广告过滤列表格式

MIT Licensednsmasqeasylist
anti-ad.net
10.6k789
217heidai/adblockfilters

去广告合并规则,每8个小时更新一次。

PythonPyPIGNU General Public License v3.0adblockfiters
7.3k416
TG-Twilight/AWAvenue-Ads-Rule

众多优秀广告规则的上游、开源社区中最棒的广告过滤器之一。适配AdGuard/Home/DNS、AdAway、hosts、Mosdns、ClashMeta、QuantumultX等主流广告拦截工具/代理工具。

Adblock Filter ListGNU General Public License v3.0adblockadblock-list
awavenue.top
6.2k164
RaspAP/raspap-webgui

The easiest, full-featured wireless router setup for Debian-based devices. Period.

PHPPackagistGNU General Public License v3.0raspberry-pihostapd
raspap.com
5.2k851
ab77/netflix-proxy

Smart DNS proxy to watch Netflix

PythonPyPIMIT Licenseshelldns-server
anton.belodedenko.me/tag/netflix-proxy/
3.7k906
nadoo/glider

glider is a forward proxy with multiple protocols support, and also a dns/dhcp server with ipset management features.

GoGo ModulesGNU General Public License v3.0gogolang
3.7k475
Loyalsoldier/surge-rules

🦄 🎃 👻 Surge 规则集(DOMAIN-SET 和 RULE-SET),适用于 Surge for iOS 和 Surge for Mac 客户端。

GNU General Public License v3.0surgegeosite
nssurge.com
3.1k197
pucherot/Pi.Alert

WIFI / LAN intruder detector. Check the devices connected and alert you with unknown devices. It also warns of the disconnection of "always connected" devices

JavaScriptnpmGNU General Public License v3.0wifilan
2.7k172
notracking/hosts-blocklists

Automatically updated, moderated and optimized lists for blocking ads, trackers, malware and other garbage

blocklisthostfile
2.3k142