我正在尝试在虚拟机 (VirtualBox) 上配置 DNS 服务器。操作系统是 Ubuntu 18.04。我使用过netstat -tulpn
,但没有使用任何端口。有人能帮我吗?
错误:
● 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'.
我的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; };
};
我的 nome.com.br.forward 文件:
;
; 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
以及 /etc/resolv.conf 文件:
nameserver 127.0.0.53
nameserver 192.168.2.75
options edns0