Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux DNSMasq中的多个addn主机配置_Linux_Dnsmasq - Fatal编程技术网

Linux DNSMasq中的多个addn主机配置

Linux DNSMasq中的多个addn主机配置,linux,dnsmasq,Linux,Dnsmasq,是否可以将多个文件添加到dnsmasq.conf中的“addn hosts”节点 目前,我有一个文件“dnsmasq.multihosts”,其中有一个要解析的服务器列表。我的问题是dnsmasq.multihosts现在太长了,我想将它分成多个文件,如“dnsmasq.database”、“dnsmasq.webserver”等,以便于维护。是的,可以在dnsmasq.conf中为--addn hosts指定多个文件。可以对多个附加主机文件重复此选项。如果给定一个目录,将读取该目录中的所有文件

是否可以将多个文件添加到dnsmasq.conf中的“addn hosts”节点


目前,我有一个文件“dnsmasq.multihosts”,其中有一个要解析的服务器列表。我的问题是dnsmasq.multihosts现在太长了,我想将它分成多个文件,如“dnsmasq.database”、“dnsmasq.webserver”等,以便于维护。

是的,可以在
dnsmasq.conf
中为
--addn hosts
指定多个文件。可以对多个附加主机文件重复此选项。如果给定一个目录,将读取该目录中的所有文件

dnsmasq --help
...
-H, --addn-hosts=<file>    Additional hosts file. Read the specified file as well as
                           /etc/hosts. If -h is given, read only the specified file.
                           This option may be repeated for more than one additional
                           hosts file. If a directory is given, then read all the files
                           contained in that directory.
dnsmasq——帮助
...
-H、 --addn hosts=附加主机文件。读取指定的文件以及
/etc/主机。如果给定-h,则仅读取指定的文件。
此选项可能会重复一次以上
主机文件。如果给定了目录,则读取所有文件
包含在该目录中。

dnsmasq
手册页面位于。

@AnkitGupta Upvote,如果您认为我的答案有用,请接受我的答案,以便其他人知道这是正确的答案,谢谢!