V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
nowheretoseek
V2EX  ›  OpenWrt

必须明文将 conf-dir=/etc/dnsmasq.d 写入/etc/dnsmasq.conf 吗?

  •  
  •   nowheretoseek · 2023-04-01 12:56:39 +08:00 · 1228 次点击
    这是一个创建于 384 天前的主题,其中的信息可能已经有所发展或是发生改变。

    刚才看一篇文章记录的配置过程中说到将conf-dir=/etc/dnsmasq.d写入/etc/dnsmasq.conf,我看了下我的,才一直以来没有把conf-dir=/etc/dnsmasq.d写入/etc/dnsmasq.conf

    /etc/dnsmasq.d下有几个定期从 github 上下载的配置文件,主要是分流和广告过滤,用了好久了,应该是起了作用的,并且之前一个配置文件下载不完整时还出现过分流失败。但我现在有点怀疑他们是否被 include 了。

    我做了这个测试:在/etc/dnsmasq.d下的某个文件中故意写入错误格式内容,然后运行dnsmasq --test,没有提示语法错误,而将conf-dir=/etc/dnsmasq.d写入/etc/dnsmasq.conf后重新运行,提示了 Syntax error 。

    哪位大哥帮解答下这个问题,谢谢!

    5 条回复    2023-04-02 02:28:53 +08:00
    crysislinux
        1
    crysislinux  
       2023-04-01 13:19:31 +08:00 via Android
    我的体验是需要写入 dnsmasq.conf 的,有的发行版不需要自己写是因为自带配置已经写了。OpenWrt 官方的版本是没写的。
    deorth
        2
    deorth  
       2023-04-01 16:04:21 +08:00 via Android
    这不是问题,问题是他 help 有个语法是说可以匹配文件夹下某一后缀名的文件,实际上我各种尝试不成功
    Andim
        3
    Andim  
       2023-04-01 17:49:52 +08:00
    @deorth 这个也不行么?他默认就有这个呀 conf-dir=/etc/dnsmasq.d/,*.conf
    lifanxi
        4
    lifanxi  
       2023-04-01 19:27:26 +08:00
    新版 OpenWrt 的话,还要注意 jail 的问题,不在白名单的里的文件夹访问不到。conf-dir 必须配置在 /etc/config/dhcp 里,自己写在 /etc/dnsmasq.conf 里生效不了。
    nowheretoseek
        5
    nowheretoseek  
    OP
       2023-04-02 02:28:53 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1065 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 18:45 · PVG 02:45 · LAX 11:45 · JFK 14:45
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.