Welcome. There was a need to create a DNS-server to support domains. There are two servers (debian), 2 ip in different subnet(1.1.1.1 and 2.2.2.2).
Yet one domain (
example.com) and ns-servers to be the following:
ns1.example.com and accordingly on the second server
ns2.example.comso, what I did:
1) ordered at the Registrar's dns servers: ns1.example.com 1.1.1.1 and ns2.example.com 2.2.2.2
2) the first server includes BIND, open port 53/tcp quote content configuratie:
$ cat /etc/bind/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";
// prime the server with knowledge of the root servers
zone "." {
the type hint;
file "/etc/bind/db.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
include "/etc/bind/named.conf.local";
$ cat /etc/bind/named.conf.options
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
auth-nxdomain no; # conform to RFC1035
listen-on-v6 { any; };
};
$ cat /etc/bind/named.conf.local
zone "example.com" {
type master;
file "/etc/bind/example.com";
};
$ cat /etc/bind/example.com
$TTL 3600
@ IN SOA ns1.example.com. support.example.com. (
2010122202 ; serial, todays date + todays serial #
10800 ; refresh, seconds
3600 ; retry, seconds
604800 ; expire, seconds
86400 ) ; minimum, seconds
@ IN NS ns1.example.com.
@ IN NS ns2.example.com.
mail IN A 1.1.1.1
ns1 IN A 1.1.1.1
www IN A 1.1.1.1
ftp IN A 1.1.1.1
example.com. IN A 1.1.1.1
example.com. IN MX 10 mail
If to do nslookup using that server (1.1.1.1), we see:
$ nslookup example.com localhost
Server: localhost
Address: 127.0.0.1#53
Name: example.com
Address: 1.1.1.1
All other servers answer: (it's been more than a day)
$ nslookup example.com
;; connection timed out; no servers could be reached
Maybe someone can tell me what's the problem?
and I would like recommendations on how to configure secondary DNS on the second server (2.2.2.2)