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

dnsmasq: 新添加一个 --ignore-address 选项.

  •  1
     
  •   aa65535 · 2014-12-30 16:56:18 +08:00 · 9304 次点击
    这是一个创建于 3414 天前的主题,其中的信息可能已经有所发展或是发生改变。

    http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commitdiff;h=32fc6db

    CHANGELOG

    Add --ignore-address option.
    Ignore replies to A-record queries which include the specified address.
    No error is generated, dnsmasq simply continues to listen for another reply.
    This is useful to defeat blocking strategies which rely on quickly supplying a forged answer to a DNS request for certain domains, before the correct answer can arrive.
    Thanks to Glen Huang for the patch.

    以后不用再维护 openwrt-dnsmasq 了 :-D

    33 条回复    2016-04-27 10:02:01 +08:00
    LazyZhu
        1
    LazyZhu  
       2014-12-30 17:19:47 +08:00
    不错,但为啥不加个min-ttl选项, 有些网站ttl设置太短...
    yuhaaitao
        2
    yuhaaitao  
       2014-12-30 17:32:12 +08:00 via Android
    看不懂呀
    aa65535
        3
    aa65535  
    OP
       2014-12-30 17:38:07 +08:00   ❤️ 1
    @LazyZhu 关于 min-ttl ,我之前也提交过 patch 给 dnsmasq 作者的,得到答复如下

    ```
    Thanks for that.

    Extending TTLs is normally considered to be a Bad Thing. Do you have an application for this which is worthwhile?

    Cheers,

    Simon.
    ```

    有谁英语好,可以给他解释一下。
    cicku
        4
    cicku  
       2014-12-30 17:44:41 +08:00
    @aa65535 他认为你的出发点就是错的。
    Showfom
        5
    Showfom  
       2014-12-30 17:48:49 +08:00 via iPhone
    @aa65535 你就说good good study day day up
    aa65535
        6
    aa65535  
    OP
       2014-12-30 18:05:20 +08:00
    @cicku 不了解中国大陆情况吧,这边无污染的 DNS 都在国外,好不容易忍受高延迟取回的解析结果,结果 TTL 只有几十秒……

    @Showfom 求个翻译。
    Showfom
        7
    Showfom  
       2014-12-30 18:06:38 +08:00
    @aa65535 好好学习天天想上 哈哈
    braveguywallce
        8
    braveguywallce  
       2014-12-30 19:25:08 +08:00
    @aa65535

    那我现在要在openwrt里更新一下dnsmasq吗? 更新完了怎么弄,还是继续添加
    no-resolv
    server=127.0.0.1#5353

    ?
    aa65535
        9
    aa65535  
    OP
       2014-12-30 19:39:18 +08:00
    @braveguywallce 这个应该会出现在 v2.73 里,目前还没有 release 。

    ignore-address=2.1.1.2
    ignore-address=4.193.80.0
    ignore-address=4.36.66.178
    ignore-address=8.105.84.0
    ...
    braveguywallce
        10
    braveguywallce  
       2014-12-30 20:11:16 +08:00 via Android
    @aa65535 太好了,期待!
    ma0dan
        11
    ma0dan  
       2014-12-30 20:21:12 +08:00
    不用添加iptables规则了,dnsmasq越发强大啊
    hanru
        13
    hanru  
       2014-12-30 23:31:06 +08:00 via Android
    可否推荐一个保持更新的gfw
    hanru
        14
    hanru  
       2014-12-30 23:33:31 +08:00 via Android
    可否推荐一个保持更新的gfw劫持dns解析后返回的污染ip地址列表?谢谢。
    hanru
        16
    hanru  
       2014-12-31 11:52:02 +08:00 via Android
    @aa65535 就是需要这个,谢谢!
    waltcow
        17
    waltcow  
       2014-12-31 14:35:24 +08:00   ❤️ 1
    @aa65535 六级低分飘过,尝试一下翻译
    Since the Chinese government has polluted the DNS service in China mainland .
    Every time we dig twitter.com in our network ,the GFW will return the false ip at first.
    so we use the unstandard port like 443,5353 to get the real ip from OpenDns server etc ,
    unfortunately,most of this DNS servers are located outside China ,every time we query Domain IP result from this DNS server,We suffer a very long-latency.
    we hope the TTL could be longer so that we don't have to query much more frequently as ususal.
    aa65535
        18
    aa65535  
    OP
       2014-12-31 15:21:49 +08:00
    @waltcow 谢谢,之前是因为想好没有充分的理由去说服作者添加这个功能,稍后我会再尝试一下。
    GPU
        19
    GPU  
       2014-12-31 17:24:02 +08:00 via iPhone
    可以说说这是什么功能吗?英文没看懂
    aa65535
        20
    aa65535  
    OP
       2014-12-31 17:41:04 +08:00
    @GPU 就是忽略指定的解析结果,等待后面的正确应答,就是 ChinaDNS 的功能,怎么用看 #9.
    GPU
        21
    GPU  
       2014-12-31 19:58:04 +08:00
    @aa65535 这样子 很溜啊 。 之前那个FreeRoute V2 的项目就可以把所有iptables 规则都干掉了。 。你的github是什么时候更新?
    aa65535
        22
    aa65535  
    OP
       2014-12-31 20:14:29 +08:00
    @GPU 目前的 openwrt-dnsmasq 也有这个功能,效果是一样的。
    今天已经将 --min-cache-ttl 选项的 patch 发送出去了,如果作者接受的话就不用再更新 github 了。
    GPU
        23
    GPU  
       2014-12-31 21:35:25 +08:00
    @aa65535 原来是这样子。 明白了。谢谢
    reguser12005
        24
    reguser12005  
       2015-01-02 12:18:56 +08:00
    @aa65535 能不能给dnsmasq增加一个tcp查询dns的功能呢? 这样污染的可以直接在dnsmasq中用server直接tcp查询, 不用再用pdnsd呢?
    waltcow
        25
    waltcow  
       2015-01-02 12:56:36 +08:00 via Android
    @reguser12005 直接在vps搭建dns服务器,使用非标准端口
    leavic
        26
    leavic  
       2015-01-14 16:46:38 +08:00
    反正这次GFW更新了这堆fake IP我是看得醉了,min ttl绝对是灭掉GFW DNS污染的利器,除非我们的VPN比GFW的返回还快,不过真要这样我就全局VPN了。:)
    leavic
        27
    leavic  
       2015-01-14 16:51:18 +08:00
    哦,我想我刚才理解错了min-ttl,想了想好像要自动滤掉前面的假IP,等待后面的真IP,单靠时间延迟确实没戏,还得维护IP列表,头痛。
    aa65535
        28
    aa65535  
    OP
       2015-01-14 16:52:05 +08:00
    @leavic 关于 --min-cache-ttl 选项,已经将 patch 提交给作者,作者也已经添加了(限制了最大 3600s)。
    aa65535
        29
    aa65535  
    OP
       2015-01-14 16:53:31 +08:00
    @leavic 需要实现 `等待后面的真IP` 的功能,可以使用 ChinaDNS 来实现 /t/158525
    myliyifei
        30
    myliyifei  
       2015-01-27 15:47:33 +08:00
    正常min-ttl都是为了负载均衡用的,我觉得。
    luzuoqing
        31
    luzuoqing  
       2015-06-23 11:48:20 +08:00
    @aa65535 从官方仓库安装的 dnsmasq-full 2.71。还是不能添加 min-cache-ttl 选项:

    root@OpenWrt:/etc/config# dnsmasq -C /etc/dnsmasq.conf

    dnsmasq: bad option at line 41 of /etc/dnsmasq.conf

    41行是:
    min-cache-ttl=3600
    luzuoqing
        32
    luzuoqing  
       2015-06-23 12:19:48 +08:00
    原来是我安装的版本过低的原因。。。
    zeroxia
        33
    zeroxia  
       2016-04-27 10:02:01 +08:00
    ignore-address 现在还有用吗?维护这个列表已经不现实了吧,现在的污染是不是随机给你垃圾 IP 。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   738 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 21:36 · PVG 05:36 · LAX 14:36 · JFK 17:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.