OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
NickyHaris
V2EX  ›  OpenWrt

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

  •  
  •   NickyHaris · Apr 1, 2023 · 2004 views
    This topic created in 1177 days ago, the information mentioned may be changed or developed.

    刚才看一篇文章记录的配置过程中说到将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 replies    2023-04-02 02:28:53 +08:00
    crysislinux
        1
    crysislinux  
       Apr 1, 2023 via Android
    我的体验是需要写入 dnsmasq.conf 的,有的发行版不需要自己写是因为自带配置已经写了。OpenWrt 官方的版本是没写的。
    deorth
        2
    deorth  
       Apr 1, 2023 via Android
    这不是问题,问题是他 help 有个语法是说可以匹配文件夹下某一后缀名的文件,实际上我各种尝试不成功
    Andim
        3
    Andim  
       Apr 1, 2023
    @deorth 这个也不行么?他默认就有这个呀 conf-dir=/etc/dnsmasq.d/,*.conf
    lifanxi
        4
    lifanxi  
       Apr 1, 2023
    新版 OpenWrt 的话,还要注意 jail 的问题,不在白名单的里的文件夹访问不到。conf-dir 必须配置在 /etc/config/dhcp 里,自己写在 /etc/dnsmasq.conf 里生效不了。
    NickyHaris
        5
    NickyHaris  
    OP
       Apr 2, 2023
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   773 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 19:56 · PVG 03:56 · LAX 12:56 · JFK 15:56
    ♥ Do have faith in what you're doing.