Where is dnsmasq started and configured?

21,813

The dnsmasq startup script is /etc/init.d/dnsmasq. It's called by symlinks from the /etc/rcX.d/ directories, for example: /etc/rc2.d/S15dnsmasq

If you don't want it to start, you can remove the package with sudo apt-get remove dnsmasq. Or you can leave it installed and just remove all symlinks from the /etc/rcX.d/ directories with the command: update-rc.d -f dnsmasq remove.

You can also edit /etc/default/dnsmasq and change "ENABLED=1" to "ENABLED=0" which will also tell it not to run in daemon mode.

Lastly, you can disable just the DHCP function by editing /etc/dnsmasq.conf and adding lines for your interfaces that you don't want DHCP on by adding, for example: "no-dhcp-interface=eth0". You might do this if you still wanted to use the DNS functionality.

Note: sometimes dnsmasq is installed as dnsmasq-base instead of dnsmasq in order to work with other packages such as NetworkManager (when sharing an internet connection) or Libvirt (for giving addresses to virtual machines).

Share:
21,813

Related videos on Youtube

Hertel89
Author by

Hertel89

Updated on September 18, 2022

Comments

  • Hertel89
    Hertel89 over 1 year

    Where is dnsmasq started and configured during the system startup under Ubuntu Lucid server?

    I have not been able to find any startup script or service that actually starts and sets up dnsmasq.

    I would like to get rid of the dhcp service, or prevent it from starting altogether.

  • Hertel89
    Hertel89 over 12 years
    Hate to say it, but the dnsmasq package isn't installed, nor do any of the files you indicated exist. Nevertheless dnsmasq is up and running.
  • Mark Russell
    Mark Russell over 12 years
    Find the path to the binary (which dnsmasq is one way) and then run the command: dpkg -S /path/to/dnsmasq. This will tell you which package owns that file.
  • Hertel89
    Hertel89 over 12 years
    dnsmasq comes from the dnsmasq-base package which was a dep of libvirt-bin. Since I'm not setting up any virtual servers I'm guessing I can remove libvirt and friends.
  • Mark Russell
    Mark Russell over 12 years
    Indeed. Could you do me a favor and mark the answer correct? :)
  • cerd
    cerd over 12 years
    I'm unsure what "and stopped networking RESULT=ok" actually does.
  • chovy
    chovy almost 11 years
    How do I add it so it starts at boot?
  • tibi
    tibi over 7 years
    ps i'm on debian