niuoh
V2EX  ›  DNS

/etc/resolv.conf 如何设置带端口的 nameserver?

  •  
  •   niuoh · May 31, 2016 · 13445 views
    This topic created in 3839 days ago, the information mentioned may be changed or developed.

    google 了一圈没找到 求指点

    10 replies  •  2017-08-07 13:01:24 +08:00
    leozhang
    leozhang
    May 31, 2016 via Android
    1
    Dnsmasq 可以满足指定端口的需求
    holyzhou
    holyzhou
    May 31, 2016
    2
    配置 dnsmasq 上游服务器,通过 dnsmasq 转
    niuoh
    niuoh
    OP
    May 31, 2016
    3
    就是说 不能通过 resolv.conf 配置了? 我用端口转发行不
    firebroo
    firebroo
    May 31, 2016
    4
    Dnsmasq
    kfll
    kfll
    May 31, 2016
    5
    osx 的 resolver 兹磁:/t/135910

    glibc 不支持
    niuoh
    niuoh
    OP
    May 31, 2016
    6
    @holyzhou 那 dnsmasq 配置 上游 dns 的格式是啥啊
    Nin
    Nin
    May 31, 2016
    7
    @niuoh
    dnsmasq 监听 53,
    然后 /etc/resolv.conf nameserver 127.0.0.1
    smileawei
    smileawei
    May 31, 2016
    8
    dnsmasq 是正途。在 dnsmasq 定义 server=ip#port 然后在 /etc/resolv.conf 配置 nameserver 为 127.0.0.1
    @niuoh
    Lentin
    Lentin
    Jun 11, 2016
    9
    伪造个不存在的假 IP 然后用 iptables 转发应该可行
    iptables -t nat -A OUTPUT -p udp --dport 53 -d 255.255.233.233 -j DNAT --to-destination 208.67.222.222:5353
    iptables -t nat -A OUTPUT -p tcp --dport 53 -d 255.255.233.233 -j DNAT --to-destination 208.67.222.222:5353
    然后在 /etc/resolv.conf 写入
    nameserver 255.255.233.233
    yech1990
    yech1990
    Aug 7, 2017
    10
    @smileawei
    不应该是 listen-address=ip:port 么?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1082 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 23:32 · PVG 07:32 · LAX 15:32 · JFK 18:32
    ♥ Do have faith in what you're doing.