I was setting up a server as in the below link https://help.ubuntu.com/community/Dnsmasq
root@user-desktop:/etc/init.d# sudo apt-get install dnsmasq
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
dnsmasq
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/15.4 kB of archives.
After this operation, 120 kB of additional disk space will be used.
Selecting previously unselected package dnsmasq.
(Reading database ... 146283 files and directories currently installed.)
Unpacking dnsmasq (from .../dnsmasq_2.59-4_all.deb) ...
Processing triggers for ureadahead ...
Setting up dnsmasq (2.59-4) ...
* Starting DNS forwarder and DHCP server dnsmasq
dnsmasq: failed to create listening socket for port 53: Address already in use [fail]
invoke-rc.d: initscript dnsmasq, action "start" failed.
Check what's listening on port 53 (domain) with:
Disable any service that is running on this port. It's usually
systemd-resolved
.Here I make sure that you have stopped the
systemd-resolved
service. I'm going to alsomask
it so it doesn't auto start on reboot.To undo what you did:
Also
sudo update-rc.d systemd-resolved disable
might also stop it from auto starting on boot but I haven't tested it. Usedefaults
instead ofdisable
to undo the command.Note that systemd-resolved is an important component for name resolution. If you don't have any name resolution service properly running and configured you might encounter
Temporary failure in name resolution
.Or you can change what port dnsmasq listens on, by editing the config file:
Hit Ctrl+W and type
listen-address=
and hit enter.Uncomment the line and add 127.0.0.1 with a different port than 53 like:
I get the same issue as you do. I think that it's true since 12.10, but this thread was closed before the release of 12.10.
Making some googling around (mostly inspired from here), I found this solution:
/etc/NetworkManager/NetworkManager.conf
file with you lovest editordns=dnsmasq
sudo service network-manager restart
But in your dnsmasq configuration (
/etc/dnsmasq.conf
), you have to be sure to listen the localhost DNS queries with the linelisten-address=127.0.0.1
.If you change the configuration of dnsmasq, don't forget to run
sudo /etc/init.d/dnsmasq restart
I hope this will help.
I had the same problem.
dnsmasq-base
was installed and listened on port 53 preventingdnsmasq
to start.It is possible to use
dnsmasq-base
insead ofdnsmasq
for the same purpose: just use another config directory: the one placed inNetwork Manager
folder:If you don't want to screw up the resolver do it like this with rc.local.
Stop dnsmasq from auto starting.
servicectl disable dnsmasq
Create file
/etc/rc.local
or/etc/rc.d/rc.local
depending on distro.Set perms
chmod +x /etc/rc.local
Edit file:
Disabling systemd-resolved on startup comes with issues. I believe it has something to do with the
/etc/resolv.conf
file but I'm not sure. All I know is that the first answer caused me a lot of problems and ultimately did not work at all. Simply stopping systemd-resolved then starting dnsmasq after full boot works perfect, at least on Mint. I can't speak on other distros.try this: sudo fuser -k 53/tcp it will print you the process id of process bound on that port then kill it using: sudo kill -9 process-id