V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
autocar23
V2EX  ›  问与答

搭建 dnsmasq 做 dns 服务器出问题了, 死活解决不了, 求大神帮忙

  •  
  •   autocar23 · 2016-04-17 13:59:24 +08:00 · 4441 次点击
    这是一个创建于 2924 天前的主题,其中的信息可能已经有所发展或是发生改变。

    主机是亚马逊 aws 的 ec2 的 vps

    系统是 Debian 3.16.7-ckt20-1+deb8u3 (2016-01-17) x86_64 GNU/Linux

    配置如下:

    $ cat /etc/dnsmasq.conf

    port = 5353
    
    listen-address = 0.0.0.0, 127.0.0.1
    
    resolv-file = /etc/resolv.conf.own
    

    $ cat /etc/resolv.conf.own

    nameserver 8.8.8.8
    

    在 vps 上

    dig @127.0.0.1 -p 5353 v2ex.com

    可以正常解析

    然后我在本地

    dig @vpsip -p 5353 v2ex.com

    就 Timed out

    换了一个美国的 vps 去 dig @vpsip -p 5353 v2ex.com 也是 Timed out

    ec2 上的防火墙已经允许全部流量

    问题出在哪里?

    6 条回复    2016-04-18 15:52:51 +08:00
    trepwq
        1
    trepwq  
       2016-04-17 14:28:34 +08:00 via iPhone
    autocar23
        2
    autocar23  
    OP
       2016-04-17 14:34:05 +08:00
    @trepwq 不一样情况呀..
    fcicq
        3
    fcicq  
       2016-04-17 22:19:52 +08:00
    没记错的话 listen-address 一次只能指定一个地址. 多个 ip 分多次指定而不是用逗号分隔.
    autocar23
        4
    autocar23  
    OP
       2016-04-18 08:35:16 +08:00
    @fcicq 我听了您的方法 改成

    listen-address = 127.0.0.1

    listen-address = 0.0.0.0

    可是外网还是不能访问到我的 dns 。。。
    fcicq
        5
    fcicq  
       2016-04-18 14:58:18 +08:00
    @autocar23 AWS 防火墙会打开吗? 另外公网这个做法很有安全问题, 你的机器会变成 DNS 攻击的放大器, 被人扫到的话不只是个账单的问题, 认为是违反 ToS 的话就不好玩了.
    autocar23
        6
    autocar23  
    OP
       2016-04-18 15:52:51 +08:00   ❤️ 1
    @fcicq 折腾了很久最后发现是 dnsmasq 并不是默认监听所有 interface, 指定了外网的 interface 之后就能正常使用了. 然后现在又把它卸载了因为确实怕被扫到🤐
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   986 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 22:40 · PVG 06:40 · LAX 15:40 · JFK 18:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.