USB OFFLINE: Ubuntu 24.04 BIND

From OnnoWiki
Jump to navigation Jump to search

Install

sudo apt update
sudo apt install -y bind9 bind9utils bind9-doc dnsutils

Edit

$ cd /etc/bind
$ sudo vi named.conf.options 
acl internal-network {
	192.168.0.0/24;
};
options { 
        directory "/var/cache/bind";
        allow-query { localhost; internal-network; };
        allow-transfer { localhost; };
        forwarders {
		8.8.8.8; 
		1.1.1.1;
	//	192.168.0.222; 
	//	192.168.0.1; 

// 192.168.88.1;

	};
       recursion yes;

dnssec-validation auto; listen-on-v6 { any; };

};


Edit

$ cd /etc/bind
$ sudo vi 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 "sekolah.sch.id" IN {
        type master;
        file "/etc/bind/forward.sekolah.sch.id";
        allow-update { none; };
};
zone "0.168.192.in-addr.arpa" IN {
        type master;
        file "/etc/bind/reverse.sekolah.sch.id";
        allow-update { none; };
};


Edit

$ cd /etc/bind
$ sudo cp db.local forward.sekolah.sch.id
$ sudo vi forward.sekolah.sch.id 
;
; BIND data file for sekolah.sch.id.
;
$TTL	604800
@	IN	SOA	sekolah.sch.id. root.sekolah.sch.id. ( 
		       20240817		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL

;Name Server Information
@       IN  NS    sekolah.sch.id.

;IP address of Your Domain Name Server(DNS)
@	IN  A     192.168.0.10

;Mail Server MX (Mail exchanger) Record
sekolah.sch.id.	IN MX 10   sekolah.sch.id.

;A Record for Host names
www     IN  A    192.168.0.10
mail    IN  A    192.168.0.10

;CNAME Record
ftp     IN CNAME www.sekolah.sch.id.