V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
niuoh
V2EX  ›  DNS

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

  •  
  •   niuoh · 2016-05-31 09:27:24 +08:00 · 12094 次点击
    这是一个创建于 2896 天前的主题,其中的信息可能已经有所发展或是发生改变。

    google 了一圈没找到 求指点

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

    glibc 不支持
    niuoh
        6
    niuoh  
    OP
       2016-05-31 11:05:18 +08:00
    @holyzhou 那 dnsmasq 配置 上游 dns 的格式是啥啊
    Nin
        7
    Nin  
       2016-05-31 11:21:35 +08:00
    @niuoh
    dnsmasq 监听 53,
    然后 /etc/resolv.conf nameserver 127.0.0.1
    smileawei
        8
    smileawei  
       2016-05-31 13:18:14 +08:00
    dnsmasq 是正途。在 dnsmasq 定义 server=ip#port 然后在 /etc/resolv.conf 配置 nameserver 为 127.0.0.1
    @niuoh
    Lentin
        9
    Lentin  
       2016-06-11 20:13:09 +08:00
    伪造个不存在的假 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  
       2017-08-07 13:01:24 +08:00
    @smileawei
    不应该是 listen-address=ip:port 么?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2896 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 14:01 · PVG 22:01 · LAX 07:01 · JFK 10:01
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.