DNS Zone Generator
DNS Zone generator









Add DNS addresses
  1. ns1.example.com - 46.41.139.131
  2. ns2.example.com - 89.117.172.182
  3. ns3.example.com - 51.75.55.91
Edit named.conf

nano /etc/bind/named.conf.local

named.conf
zone "example.com" {
    type master;
    file "/etc/bind/zones/db.example.com"; # zone file path
    allow-transfer {
        89.117.172.182;
        51.75.55.91;
    };
    also-notify {
        89.117.172.182;
        51.75.55.91;
    };
};
Create db.example.com

mkdir -p /etc/bind/zones

nano /etc/bind/zones/db.example.com

db.example.com
;
; BIND data file for local loopback interface
;
$TTL	3600
@	IN	SOA	ns1.example.com. root.example.com. (
			2023021901	; Serial
			3600		; Refresh
			7200		; Retry
			2419200		; Expire
			7200		; Negative Cache TTL
			);

; NS records
@		IN	NS	ns1.example.com.
@		IN	NS	ns2.example.com.
@		IN	NS	ns3.example.com.

; SPF records
@		IN	TXT	"v=spf1 -all"

; Host records
@		IN	A	51.75.55.91
www		IN	CNAME	@

; NS addresses
ns1		IN	A	46.41.139.131
ns2		IN	A	89.117.172.182
ns3		IN	A	51.75.55.91
Restart Bind
  1. named-checkzone example.com /etc/bind/zones/db.example.com
  2. service named reload ; service named status
  3. tail -f -n 500 /var/log/named/bind.log | grep 'example.com'
Edit slave DNS named.conf

nano /etc/bind/named.conf.local

Slave DNS named.conf
zone "example.com" {
    type slave;
    file "db.example.com";
    masters {
        46.41.139.131;
    };
};
Restart slave Bind
  1. service named reload; service named status;
  2. tail -f -n 500 /var/log/named/bind.log | grep 'example.com'