V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
losoft
V2EX  ›  OpenWrt

将 OpenWrt 默认的域名解析由 dnsmasq 换为 dns2socks

  •  
  •   losoft · 115 天前 · 1557 次点击
    这是一个创建于 115 天前的主题,其中的信息可能已经有所发展或是发生改变。

    1.禁止 dnsmasq 再使用 53 端口,方法是: 网络->DHCP/DNS->高级设置”中将 DNS 监听端口设置为 0

    2.手工运行 dns2socks 服务: ./dns2socks -l 0.0.0.0:53 -d 1.1.1.1:53 -s socks5://username:[email protected]:1080 程序下载地址: https://github.com/tun2proxy/dns2socks 其中 xxx.xxx.xxx.xxx:1080 是事先已经搭建好的 vps 上面的 socks5 服务。

    3.openwrt---网络---诊断 nslookup 正确解析出域名 google.com 的 ip 地址

    Server: 127.0.0.1 Address: 127.0.0.1#53

    Non-authoritative answer: Name: google.com Address: 142.250.176.14 Name: google.com Address: 2607:f8b0:4007:818::200e

    3 条回复    2025-06-27 21:55:34 +08:00
    crysislinux
        1
    crysislinux  
       115 天前 via Android
    其实没必要完全禁用 dnsmasq ,写个配置把 dnsmasq 的请求全部转发给别的 dns 服务就好了
    wuruxu
        2
    wuruxu  
       114 天前
    dnsmasq 好用的很
    1. 把 1.1./16 和 8.8./16 全部,通过 nfset, 启动后自动 使用 wireguard VPN 通道
    2. 在 dnsmasq 配置哪些域名流量通过 1.1. 去解析并加入 nfset , 这样你就在整个 WIFI 上开启了透明代理
    chuxi
        3
    chuxi  
       75 天前
    真辛苦,dnsmasq 的 DHCP 以及其他的高级功能非常有用
    参考
    https://github.com/9566618/shadowproxy/wiki
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   987 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 18ms · UTC 19:13 · PVG 03:13 · LAX 12:13 · JFK 15:13
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.