Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple addn-hosts conf in DNSMasq

Tags:

linux

dnsmasq

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.

like image 999
Ankit Gupta Avatar asked Oct 16 '25 01:10

Ankit Gupta


1 Answers

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.

like image 182
Vikram Hosakote Avatar answered Oct 17 '25 13:10

Vikram Hosakote