Ubuntu – Problems setting up dnsmasq

dhcpdnsmasqUbuntu

Its currently set up as follows:

# /etc/dnsmasq.conf

domain-needed
bogus-priv
address=/doubleclick.net/127.0.0.1
except-interface=eth0
dhcp-range=interface:eth1,192.168.1.10,192.168.1.127,12h
dhcp-range=interface:eth2,192.168.2.10,192.168.2.127,12h
log-queries

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
    address 192.168.0.128
    netmask 255.255.255.0

auto eth1
iface eth1 inet static
    address 192.168.1.128
    netmask 255.255.255.0

auto eth2
iface eth2 inet static
    address 192.168.2.128
    netmask 255.255.255.0

Edit: gave static IPs to all.

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

Best Answer

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