Dnsmasq

指定 resolv-file 時,dnsmasq 是否支持 no-resolv?

  • May 14, 2021

這些 dnsmasq 選項是否衝突?路由器想要寫入resolv-file配置,但允許我追加no-resolv. 在這種情況下會dnsmasq同意忽略嗎?resolv-file

resolv-file=/tmp/resolv.dnsmasq
no-resolv

在這種情況下,dnsmasq 會同意忽略 resolv-file 嗎?

檢查dnsmasq2.76

if (daemon->port != 0 && option_bool(OPT_NO_RESOLV))
   {
     if (daemon->resolv_files && !daemon->resolv_files->is_default)
   my_syslog(LOG_WARNING, _("warning: ignoring resolv-file flag because no-resolv is set"));
     daemon->resolv_files = NULL;

dnsmasq將檢查OPT_NO_RESOLVno-resolv選項)是否啟用。如果是這樣,並且resolv_file設置為而不是其預設值,它將設置resolv_fileNULL並發出警告。

所以,是的,如果已設置,dnsmasq將忽略。resolv-file``no-resolv

引用自:https://serverfault.com/questions/1063548