Where is dnsmasq started and configured?
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).
Related videos on Youtube
Hertel89
Updated on September 18, 2022Comments
-
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 over 12 yearsHate 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 over 12 yearsFind 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 over 12 yearsdnsmasq 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 over 12 yearsIndeed. Could you do me a favor and mark the answer correct? :)
-
cerd over 12 yearsI'm unsure what "and stopped networking RESULT=ok" actually does.
-
chovy almost 11 yearsHow do I add it so it starts at boot?
-
tibi over 7 yearsps i'm on debian