PDA

View Full Version : [SOLVED] dnsmasq "Address already in use"



cong06
May 5th, 2010, 12:45 PM
I have a squid and apt-cacher running on a transparent server, and I'm trying to set up net booting.

I'm following the guide: https://help.ubuntu.com/community/Installation/Netboot

Unfortunately, when I tried to start dnsmasq, I got the error:


dnsmasq: failed to create listening socket: Address already in use


Following internet advice, I tried:


root@kimende-s:~# netstat -anlp | grep -w LISTEN
and found that dnsmasq was listed even though it was throwing this error.

So I decided to purge it.

After purging (and then restarting, to try and clear any problems) I noticed that it was still listed:


root@kimende-s:~# netstat -anlp | grep -w LISTEN
tcp 0 0 0.0.0.0:3142 0.0.0.0:* LISTEN 2388/perl
tcp 0 0 10.42.43.1:53 0.0.0.0:* LISTEN 4489/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2375/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2723/cupsd
tcp 0 0 0.0.0.0:3128 0.0.0.0:* LISTEN 2655/(squid)
tcp6 0 0 :::22 :::* LISTEN 2375/sshd
tcp6 0 0 ::1:631 :::* LISTEN 2723/cupsd


Does anyone know why it's still listed even though it's uninstalled?
Last time I was having problems with named...

This is a brand new install... only changes were those mentioned: installing squid and apt-cacher.

Note: I'm using Network Manager as my router. I think this comes with named? I'm not sure...

cdenley
May 5th, 2010, 02:13 PM
Someone or something probably started it without using the init scripts.


sudo ps -f -p 4489
sudo kill 4489

cong06
May 5th, 2010, 02:41 PM
ok. So as soon as I killed it, the eth0 connection died.

It seems Network Manager running a "dnsmasq" program (even though dnsmasq isn't installed) on port 53 for my "shared to other computer" eth0 connection.

Is there any easy way to use NetworkManager along with a netbooting server?


I'd rather not drop NetworkManager as it's handling my ppp connections...

cdenley
May 5th, 2010, 02:48 PM
/usr/sbin/dnsmasq is provided by dnsmasq-base which is a dependency of network-manager.

cong06
May 5th, 2010, 03:45 PM
huh. so it seems that I don't need dnsmasq, just dnsmasq-base

However, the configuration isn't provided with dnsmasq-base, so I installed dnsmasq, just for the config to finish the walkthrough.

That's rather messy...

Edit:
I just noticed that when I turn on my computer, with dnsmasq installed, dnsmasq successfully starts, so when network manager wants to run it's own version, it fails.
To fix this, I ran:


chmod -x /etc/init.d/dnsmasq

Now dnsmasq will only start with network manager and will still use the config.

It's possible that uninstalling the package will work (but not purging) but I'll stick to this.

Truthiswithin
July 22nd, 2011, 03:17 PM
Great to find this thread! I uninstalled dnsmasq and sure enough, the /etc/dnsmasq.d directory disappears. But, there is still the /etc/dnsmasq.conf which is enough.

mpd2
June 7th, 2012, 03:28 PM
I got around this by replacing dnsmasq-base with dnsmasq. Because of dependencies on it, I did the following:

sudo apt-get remove dnsmasq-base (this removes network manager...)
sudo apt-get install dnsmasq
sudo apt-get install network-manager network-manager-gnome

cong06
June 7th, 2012, 04:53 PM
I got around this by replacing dnsmasq-base with dnsmasq. Because of dependencies on it, I did the following:

sudo apt-get remove dnsmasq-base (this removes network manager...)
sudo apt-get install dnsmasq
sudo apt-get install network-manager network-manager-gnome


One liner:


sudo aptitude install dnsmasq dnsmasq-base-


It should take less time this way, and be less likely to remove files you want. You'll need to `sudo apt-get install aptitude` though.

The minus at the end of dnsmasq-base tells it to remove, instead of installing. this is the same:


sudo aptitude remove dnsmasq+ dnsmasq-base

mpd2
June 7th, 2012, 05:05 PM
Thanks for pointing that out, cong06.

sffvba[e0rt
June 7th, 2012, 05:31 PM
Old thread closed.


404