ubuntu – Bind9 unable to listen on any configured interfaces

im trying to configure a DNS Server on a VM (VirtualBox). OS is Ubuntu 18.04. I used netstat -tulpn and no port were being used. Can anyone help me?

Error:

● bind9.service - BIND Domain Name Server
     Loaded: loaded (/etc/systemd/system/bind9.service; disabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Fri 2022-02-25 20:01:43 -03; 2s ago
       Docs: man:named(8)
    Process: 3365 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
   Main PID: 3365 (code=exited, status=1/FAILURE)

fev 25 20:01:43 felipe-VirtualBox named[3365]: using default UDP/IPv4 port range: [32768, 60999]
fev 25 20:01:43 felipe-VirtualBox named[3365]: listening on IPv4 interface lo, 127.0.0.1#53
fev 25 20:01:43 felipe-VirtualBox named[3365]: creating TCP socket: address in use
fev 25 20:01:43 felipe-VirtualBox named[3365]: listening on IPv4 interface enp0s3, 192.168.2.75#53
fev 25 20:01:43 felipe-VirtualBox named[3365]: creating TCP socket: address in use
fev 25 20:01:43 felipe-VirtualBox named[3365]: unable to listen on any configured interfaces
fev 25 20:01:43 felipe-VirtualBox named[3365]: loading configuration: failure
fev 25 20:01:43 felipe-VirtualBox named[3365]: exiting (due to fatal error)
fev 25 20:01:43 felipe-VirtualBox systemd[1]: bind9.service: Main process exited, code=exited, status=1/FAILURE
fev 25 20:01:43 felipe-VirtualBox systemd[1]: bind9.service: Failed with result 'exit-code'.

My named.conf.local:

//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "nome.com.br"
{
        type master;
        file "/etc/bind/nome.com.br.forward";
        allow-transfer { 192.168.2.75; };
};


My nome.com.br.forward file:

;
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns1.nome.com.br. root.nome.com.br. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.nome.com.br.
gateway IN      A       192.168.2.253
celular IN      A       192.168.2.159
ns1     IN      A       192.168.2.75
route   IN      CNAME   gateway

And /etc/resolv.conf file:

nameserver 127.0.0.53
nameserver 192.168.2.75
options edns0

Read more here: Source link