0

I have an Edgerouter 4 and I am trying to make sense of the configuration areas for DHCP and DNS, when use-dnsmasq enable is set.

I see four places where the configuration can be done:

  1. from the command line (set service dns forwarding ... seems to be the way to provide DNS parameters (but not DHCP?))

  2. by editing (EDIT: a copy of) /config/config.boot and loading it up

These two seem to be tightly linked together, the command line config seems to be written to /config/config.boot

  1. by configuring /etc/dnsmasq.conf

  2. by adding a file to /etc/dnsmasq.d

The configurations follows the dnsmasq configuration file, I have the file /etc/dnsmasq.d/dnsmasq-dhcp-config.conf which was created for me.

Note: I have a strong preference for the approach where /etc/dnsmasq.conf would be all commented out as it is today, and have all my DNS and DHCP cpnfiguration in files living in /etc/dnsmasq.d. I can accept that this configuration will not be visible from the GUI (in the DNS page).

My questions

  • How do these configuration approaches work together?
  • Is it possible to only use the approach 3. or 4.?
  • If yes:
    • are there drawbacks? (= inconveniences such as the need to backup teh files during an upgrade, lack of visibility in the GUI, etc.)
    • are there incompatibilities? (= something can be configured exclusively via 1., 2. or 3./4.?)
WoJ
  • 3,607
  • 9
  • 49
  • 79

1 Answers1

1

2) generally you would never do, as a reboot would be required to apply config changes. The set commands which ultimately save their changes there should be used instead, outside of specific circumstances like scripting config generation en masse when deploying a lot of systems with similar configs.

3) isn't viable because anything that reconfigures dnsmasq will overwrite changes.

4) will work, but won't survive a firmware upgrade so is inadvisable.

The set commands are preferred. Depending on what you're looking to configure exactly, the dns forwarding custom config may suffice even though it doesn't go into the DHCP portion of the dnsmasq config.

Chris Buechler
  • 2,998
  • 14
  • 18
  • Thank you, I have a few questions about your answer: in 2) I realized I forgot to add "a copy of" - updated in the question. As for 4): would keeping the file in /config/ and have a link help? Also, `/etc/dnsmasq.d/dnsmasq-dhcp-config.conf` is generated at some point and holds a part of the `dnsmasq` configuration (while another piece is in `/config/config.boot` so the whole thing looks quite messy as it stands. – WoJ Mar 20 '19 at 12:17