Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Its currently set up as follows:

# /etc/dnsmasq.conf


I have 3 network cards, eth0 is connected to ADSL router, eth1 is connected to wireless AP and eth2 to switch and other computers are connected to that switch.

When I try to start dnsmasq I get "dnsmasq: failed to create listening socket: Address already in use"

lsof -i

shows only following commands: portmap, rpc.statd, smbd, sshd, mysqld, named, samba and apache2.

netstat -antuevp

shows only programs: mysqld, smbd, rpc.statd, portmap, apache2, named, sshd and smbd.

I did have dhcp client and server installed before installing dnsmasq, but have removed it since.

Here's /etc/network/interfaces if that can help:

# /etc/network/interfaces
auto lo
iface lo inet loopback

mapping hotplug
        script grep
        map eth1

auto eth0
iface eth0 inet static

auto eth1
iface eth1 inet static

auto eth2
iface eth2 inet static

Edit: gave static IPs to all.

Also, someone on dnsmasq suggested to remove named so I'll try that as well.

share|improve this question
up vote 2 down vote accepted

If you're trying to run DHCP on them, which don't eth1 and eth2 have static addresses? I assume you're trying to isolate the wireless network from the wired LAN (otherwise you'll need bridging)?

share|improve this answer
Its not so much that I want to isolate them, I just want them in separate subnets... – Shinhan Jun 25 '10 at 4:45
I dont want to isolate them, I just thought they should be in separate subnets. I still want them in the same windows workgroup and able to communicate with each other. WAP is different interface only for later when I want to throttle it more than wired connections, and apply stricter firewall rules. – Shinhan Jun 25 '10 at 4:55
Have you tried giving eth1 and eth2 static IP addresses in /etc/network/interfaces? If this machine is supposed to act as the DHCP server for those subnets, it doesn't really make sense to expect it to get its own IP address from some other DHCP server - and it doesn't make sense to expect it to participate in the DHCP protocol without having an IP address. From a quick look at the source code, it looks to me like the error message you're seeeing reflects a general failure to create a socket, but not necessarily because the IP:PORT pair is already in use. – gbroiles Jun 25 '10 at 7:26
ok, I changed so it uses static IPs. Also, someone on dnsmasq mlist suggested to remove named so I'll try that as well. – Shinhan Jun 25 '10 at 10:38
Yea, turns out named is part of bind9 which is DNS server, so I removed it, and now DNS works. Still no internet on the rest of the network, but thats no longer the same question. – Shinhan Jun 25 '10 at 12:43

Your Answer


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.