vps交流

[经验] Dnsmasq 强制 Netflix 走 IPv4


本帖最后由 chao 于 2022-3-18 13:18 编辑

Netflix 默认 IPv6 优先,这就导致如果家里的宽带支持 IPv6,Netflix就会提示not available。
简单的做法是直接关闭 IPv6 ,但这样对于只有 IPv6 公网的用户来说会很不方便。
这时可以设置 Dnsmasq 使得 Netflix 的 AAAA 解析为空。

主路由 AC86U

  1. cat >> /jffs/configs/dnsmasq.d/dnsmasq.conf <<EOF
  2. # Null AAAA response on these domains
  3. server=/fast.com/#
  4. address=/fast.com/::
  5. server=/netflix.com/#
  6. address=/netflix.com/::
  7. server=/netflix.net/#
  8. address=/netflix.net/::
  9. server=/nflxso.net/#
  10. address=/nflxso.net/::
  11. server=/nflxext.com/#
  12. address=/nflxext.com/::
  13. server=/nflximg.com/#
  14. address=/nflximg.com/::
  15. server=/nflximg.net/#
  16. address=/nflximg.net/::
  17. server=/nflxvideo.net/#
  18. address=/nflxvideo.net/::
  19. server=/netflixdnstest0.com/#
  20. address=/netflixdnstest0.com/::
  21. server=/netflixdnstest1.com/#
  22. address=/netflixdnstest1.com/::
  23. server=/netflixdnstest2.com/#
  24. address=/netflixdnstest2.com/::
  25. server=/netflixdnstest3.com/#
  26. address=/netflixdnstest3.com/::
  27. server=/netflixdnstest4.com/#
  28. address=/netflixdnstest4.com/::
  29. server=/netflixdnstest5.com/#
  30. address=/netflixdnstest5.com/::
  31. server=/netflixdnstest6.com/#
  32. address=/netflixdnstest6.com/::
  33. server=/netflixdnstest7.com/#
  34. address=/netflixdnstest7.com/::
  35. server=/netflixdnstest8.com/#
  36. address=/netflixdnstest8.com/::
  37. server=/netflixdnstest9.com/#
  38. address=/netflixdnstest9.com/::
  39. EOF
  40. service restart_dnsmasq

复制代码

旁路由 N1(F大OpenWrt)

  1. cat >> `ps -w | grep dnsmasq | grep -Eo /var/etc/dnsmasq.conf[.][a-zA-Z0-9]+` <<EOF
  2. # Null AAAA response on these domains
  3. server=/fast.com/#
  4. address=/fast.com/::
  5. server=/netflix.com/#
  6. address=/netflix.com/::
  7. server=/netflix.net/#
  8. address=/netflix.net/::
  9. server=/nflxso.net/#
  10. address=/nflxso.net/::
  11. server=/nflxext.com/#
  12. address=/nflxext.com/::
  13. server=/nflximg.com/#
  14. address=/nflximg.com/::
  15. server=/nflximg.net/#
  16. address=/nflximg.net/::
  17. server=/nflxvideo.net/#
  18. address=/nflxvideo.net/::
  19. server=/netflixdnstest0.com/#
  20. address=/netflixdnstest0.com/::
  21. server=/netflixdnstest1.com/#
  22. address=/netflixdnstest1.com/::
  23. server=/netflixdnstest2.com/#
  24. address=/netflixdnstest2.com/::
  25. server=/netflixdnstest3.com/#
  26. address=/netflixdnstest3.com/::
  27. server=/netflixdnstest4.com/#
  28. address=/netflixdnstest4.com/::
  29. server=/netflixdnstest5.com/#
  30. address=/netflixdnstest5.com/::
  31. server=/netflixdnstest6.com/#
  32. address=/netflixdnstest6.com/::
  33. server=/netflixdnstest7.com/#
  34. address=/netflixdnstest7.com/::
  35. server=/netflixdnstest8.com/#
  36. address=/netflixdnstest8.com/::
  37. server=/netflixdnstest9.com/#
  38. address=/netflixdnstest9.com/::
  39. EOF
  40. kill `ps | grep dnsmasq | grep -E dnsmasq.conf[.][a-zA-Z0-9]+  | awk ‘{print $1}’`
  41. # 等待几秒 dnsmasq 会自动重启

复制代码

效果
[经验]  Dnsmasq 强制 Netflix 走 IPv4
[经验]  Dnsmasq 强制 Netflix 走 IPv4

我超 大佬就等你的方案了 我之前被迫关闭了IPv6[经验]  Dnsmasq 强制 Netflix 走 IPv4
大佬果然优秀,请收下小弟的膝盖
感谢,看样子终于可以用ipv6了
我选择在pdnsd里操作为空
xray直接分流不就好了么

过客屡屡如烟 发表于 2022-3-18 14:04
xray直接分流不就好了么

用的旁路由,设置网关和dns后,手机连上主路由后还是会自动走ipv6,所以在主路由屏蔽Netflix ipv6解析