4

Is it possible to add multiple files to the "addn-hosts" node in dnsmasq.conf?

Currently I have a single file "dnsmasq.multihosts" which has a list of servers for DNSmasq to resolve. My problem is that dnsmasq.multihosts is too long now and I would like to separate it into multiple Files like "dnsmasq.database", "dnsmasq.webserver" etc for easy maintenance.

Ankit Gupta
  • 565
  • 6
  • 18

1 Answers1

3

Yes, it is possible to specify multiple files for --addn-hosts in dnsmasq.conf. This option may be repeated for more than one additional hosts file. If a directory is given, all the files in that directory will be read.

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.

The dnsmasq manual page is at http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html.

Vikram Hosakote
  • 3,528
  • 12
  • 23