DNS Zone Generator
DNS Zone generator








Add DNS addresses
  1. ns1.example.com - 46.41.139.131
  2. ns2.example.com - 66.151.48.247
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 {
        66.151.48.247;
    };
    also-notify {
        66.151.48.247;
    };
};
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.

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

; Host records
		IN	A	69.25.112.233
www		IN	CNAME	example.com.

ns1		IN	A	46.41.139.131
ns2		IN	A	66.151.48.247

_dmarc		IN	TXT	"v=DMARC1; p=reject; adkim=r; aspf=r;"
mail		IN	TXT	"v=spf1 -all"
Restart Bind
  1. named-checkzone example.com /etc/bind/zones/db.example.com
  2. service named restart ; 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 restart; service named status;
  2. tail -f -n 500 /var/log/named/bind.log | grep 'example.com'