5

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.

2 Answers 2

8

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).

8
  • When I started answering, I really didn't think there would be 4 different answers. That's kinda nuts. Sep 27, 2011 at 0:32
  • 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.
    – Marsh
    Sep 29, 2011 at 19:43
  • 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. Sep 29, 2011 at 20:13
  • 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.
    – Marsh
    Sep 30, 2011 at 0:35
  • Indeed. Could you do me a favor and mark the answer correct? :) Sep 30, 2011 at 4:16
0

I found two solutions, I don't want to uninstall the libvirt package so

I either disable it in:

/etc/default/libvirt-bin:

start_libvirtd="no"

Or edit:

/etc/init/libvirt-bin.conf

#start on (runlevel [2345] and stopped networking RESULT=ok)
start on runlevel [45]
1
  • I'm unsure what "and stopped networking RESULT=ok" actually does. Nov 3, 2011 at 8:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .