niuoh
V2EX  ›  DNS

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

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

    google 了一圈没找到 求指点

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

    glibc 不支持
    niuoh
        6
    niuoh  
    OP
       May 31, 2016
    @holyzhou 那 dnsmasq 配置 上游 dns 的格式是啥啊
    Nin
        7
    Nin  
       May 31, 2016
    @niuoh
    dnsmasq 监听 53,
    然后 /etc/resolv.conf nameserver 127.0.0.1
    smileawei
        8
    smileawei  
       May 31, 2016
    dnsmasq 是正途。在 dnsmasq 定义 server=ip#port 然后在 /etc/resolv.conf 配置 nameserver 为 127.0.0.1
    @niuoh
    Lentin
        9
    Lentin  
       Jun 11, 2016
    伪造个不存在的假 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
        10
    yech1990  
       Aug 7, 2017
    @smileawei
    不应该是 listen-address=ip:port 么?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1234 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 41ms · UTC 23:33 · PVG 07:33 · LAX 16:33 · JFK 19:33
    ♥ Do have faith in what you're doing.