5

I am trying to set up a DNS server on a Raspberry pi running Raspbian. I have been following tutorials online on how to setup a DNS server, and I found this one that was very easy to follow.

http://www.heystephenwood.com/2013/06/use-your-raspberry-pi-as-dns-cache-to.html

I followed the directions and installed dnsmasq via the link listed on this site

curl "https://raw.github.com/stephendotexe/raspberrypi/master/roles/dnsmasq_server" | sudo sh,

but when it attempted to start dnsmasq, it gave me the error;

dnsmasq: failed to create listening socket for port 53: Address already in use failed!

I did some research and I came across this post on the Askubuntu site.

https://askubuntu.com/questions/191226/dnsmasq-failed-to-create-listening-socket-for-port-53-address-already-in-use

Again, I followed the directions and it appeared that dnsmasq interferes with Network Manager, so I ran the following commands, as directed by the post.

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

Again, this didn't solve my problem. I tried to use lsof to figure out what is using port 53, so I installed it with sudo apt-get install lsof and ran the command;

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

I got this output

COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
named   1955 bind   20u  IPv4   2467      0t0  TCP 127.0.0.1:53 (LISTEN)
named   1955 bind   21u  IPv4   2469      0t0  TCP 192.168.0.102:53 (LISTEN)
named   1955 bind  512u  IPv4   2466      0t0  UDP 127.0.0.1:53 
named   1955 bind  513u  IPv4   2468      0t0  UDP 192.168.0.102:53

I assume this means I need to uninstall BIND or at least make it not execute on startup.

5
  • You need to run lsof as root: sudo lsof +M -nPi :53 Sep 21, 2013 at 8:25
  • Ok. I think that BIND is taking up port 53, but I'm not sure if I'm interpreting the readout correctly. There are 5 processes running and under the USER column they all say bind. Does this mean that BIND is running and I need to uninstall it? COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME named 1955 bind 20u IPv4 2467 0t0 TCP 127.0.0.1:53 (LISTEN) named 1955 bind 21u IPv4 2469 0t0 TCP 192.168.0.102:53 (LISTEN) named 1955 bind 512u IPv4 2466 0t0 UDP 127.0.0.1:53 named 1955 bind 513u IPv4 2468 0t0 UDP 192.168.0.102:53
    – qaxf6auux
    Sep 21, 2013 at 8:32
  • Also BIND is a DNS server, correct?
    – qaxf6auux
    Sep 21, 2013 at 8:33
  • Yes, bind/named is a DNS server. You could edit your question and include the output of that lsof command. Sep 21, 2013 at 8:34
  • 1
    I fixed it. I cannot answer my question for another 7 hours, however.
    – qaxf6auux
    Sep 21, 2013 at 8:48

1 Answer 1

1

in your DNSMASQ.conf, be sure TFTP is disabled for the concerned interface (eth8 in my case, replace by yours)

# = dont provide DHCP or TFTP on this interface : (BUT provide DNS service)
no-dhcp-interface=eth8
1
  • What DNSMASQ.conf? Jul 8, 2020 at 23:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.