0

I am trying to use my ubuntu machine as DNS server. I have installed the bind 9 package.

I am using dig to check the DNS server. However I am getting a ICMP type 3 code 3 message on the client.

This is the message for an unavailable port. However port 53 is listening for DNS connections.

Here is output for UFW.

root@server:/etc/bind# ufw status
Status: active

To                         Action      From
--                         ------      ----
80                         ALLOW       Anywhere
20/tcp                     ALLOW       Anywhere
21/tcp                     ALLOW       Anywhere
22                         ALLOW       Anywhere
443                        ALLOW       Anywhere
Anywhere                   ALLOW       20.20.20.0/24
20                         ALLOW       Anywhere
514                        ALLOW       Anywhere
Anywhere                   ALLOW       21.21.21.0/24
554                        ALLOW       Anywhere
53                         ALLOW       Anywhere
80 (v6)                    ALLOW       Anywhere (v6)
20/tcp (v6)                ALLOW       Anywhere (v6)
21/tcp (v6)                ALLOW       Anywhere (v6)
22 (v6)                    ALLOW       Anywhere (v6)
443 (v6)                   ALLOW       Anywhere (v6)
20 (v6)                    ALLOW       Anywhere (v6)
514 (v6)                   ALLOW       Anywhere (v6)
554 (v6)                   ALLOW       Anywhere (v6)
53 (v6)                    ALLOW       Anywhere (v6)

20.20.20.0/24 is the subnet of the client, and I am allowing all packets from that subnet.

Here is the output of netstat:

root@server:/etc/bind# netstat -nlpu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:51139           0.0.0.0:*                           913/avahi-daemon: r
udp     6144      0 127.0.1.1:53            0.0.0.0:*                           1236/dnsmasq
udp        0      0 0.0.0.0:69              0.0.0.0:*                           1427/in.tftpd
udp     2176      0 0.0.0.0:53671           0.0.0.0:*                           1236/dnsmasq
udp        0      0 0.0.0.0:514             0.0.0.0:*                           918/rsyslogd
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1165/cups-browsed
udp    14848      0 0.0.0.0:5353            0.0.0.0:*                           913/avahi-daemon: r
udp6       0      0 :::69                   :::*                                1427/in.tftpd
udp6       0      0 :::45412                :::*                                913/avahi-daemon: r
udp6       0      0 :::514                  :::*                                918/rsyslogd
udp6   17152      0 :::5353                 :::*                                913/avahi-daemon: r

Port 53 is on listening on localhost. Could that be the issue ?

Edit---

The bind9 config file is set up to listen on port 53 for remote IP addresses.

named.conf

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";


forwarders {
                8.8.8.8;
                8.8.4.4;
           };

listen-on port 53 { 127.0.0.1; 21.21.21.1; };

allow-query { 127.0.0.1; 20.20.20.0/24; };

zone "1.168.192.in-addr.arpa" {
        type master;
        file "/etc/bind/db.192";
};
~

Thanks

0

Could you let port 53 to go out anywhere?
Shell command:

sudo ufw allow out 53

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.