Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.
share|improve this question
add comment

2 Answers

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:

  • edit /etc/NetworkManager/NetworkManager.conf file with you lovest editor
  • comment the line dns=dnsmasq
  • restart the network manager : sudo restart network-manager

But in your dnsmasq configuration (/etc/dnsmasq.conf), you have to be sure to listen the localhost DNS queries with the line listen-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.

share|improve this answer
    
By commenting out dns=dnsmasq doesn't that defeat the purpose of installing DNSmasq. I made the listen-address=127.0.0.1 change and it seems to work fine now. –  Jay Storn Jan 7 at 22:32
add comment

EDIT: some googling, and I found the solution. It seems that the network manager depends on a package called "dnsmasq-base" which provides some of the dnsmasq functionality. Dnsmasq entry in the Ubuntu Wiki states that

"Note that the package "dnsmasq" interferes with Network Manager which can use "dnsmasq-base" to provide DHCP services when sharing an internet connection. Therefore, if you use network manager (fine in simple set-ups only), then install dnsmasq-base, but not dnsmasq. If you have a more complicated set-up, uninstall network manager, use dnsmasq, or similar software (bind9, dhcpd, etc), and configure things by hand."

In other words: you want to use dnsmasq? Then you better know what you are doing. The solution mentioned earlier suggests to replace dnsmasq-base by dnsmasq the following way (the first command will also remove network-manager):

sudo apt-get remove dnsmasq-base
sudo apt-get install dnsmasq
sudo apt-get install network-manager network-manager-gnome

And here some general comments on finding what blocks your ports: You can find what is listening on which port by using lsof:

lsof -Pn +M -i4

will list the IPv4 ports due to the -i4, while

lsof -Pn +M -i6

will list the IPv6 ports. Or type just

lsof -Pn +M | grep ':53 (LISTEN)'

This should (hopefully) tell you what is using port 53. The -Pn command line switches prevent the conversion of port number / host IP's to names.

Alternatively, run

netstat -utlnp
share|improve this answer
2  
Don't remove dnsmasq-base; the dnsmasq package depends on it! –  jdthood Dec 13 '12 at 9:35
1  
Be careful when doing this, after running sudo apt-get remove dnsmasq-base I was left with no network connection so I couldn't do the next steps! The solution turned out to be running dhclient to get a new IP address. –  Glenjamin Feb 6 '13 at 15:34
add comment

Your Answer

 
discard

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.