Skip to content

dnsmasq.conf

Calin Crisan edited this page Dec 12, 2022 · 12 revisions

File Location And Role

The following files are tested in this order and the first one that is found will be used to configure the dnsmasq daemon:

  • /data/etc/dnsmasq.conf
  • /boot/dnsmasq.conf
  • /etc/dnsmasq.conf

The file is not present by default and should be created by the user, if dnsmasq is needed.

If the file is present, the dnsmasq daemon will be started to make your system act as a DHCP server (and other possible dnsmasq functionalities).

Note that dnsmasq package is not enabled by default in thingOS. You'll need to enable it in your configurations to have this functionality.

See also captive-portal.conf.

File Format

Here are some details on the file format.

The file is first preprocessed and any environment variables of the form $var or ${var} are replaced. You can use any variables exported by /etc/init.d/base, which include all os.conf variables and others such as HOSTNAME, BOARD_SNandBOARD_NAME`.

Example

Following is a simple example of a dnsmasq configuration that will enable the DHCP server on the wlan0 interface, offering IP addresses in the range of 192.168.27.50 to 192.168.27.150, valid for 24 hours:

interface=${OS_AP}
dhcp-range=192.168.27.50,192.168.27.150,24h
dhcp-leasefile=/var/lib/dnsmasq.leases
Clone this wiki locally