Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

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|improve this answer
    
When I started answering, I really didn't think there would be 4 different answers. That's kinda nuts. –  Mark Russell Sep 27 '11 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 '11 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. –  Mark Russell Sep 29 '11 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 '11 at 0:35
    
Indeed. Could you do me a favor and mark the answer correct? :) –  Mark Russell Sep 30 '11 at 4:16
show 1 more comment

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]
share|improve this answer
    
I'm unsure what "and stopped networking RESULT=ok" actually does. –  Erik Johansson Nov 3 '11 at 8:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.