Skip to content

Instantly share code, notes, and snippets.

@katoozi
Last active May 18, 2019 08:41
Show Gist options
  • Save katoozi/3a6d0ce7b44480e49a21da63f3d8284f to your computer and use it in GitHub Desktop.
Save katoozi/3a6d0ce7b44480e49a21da63f3d8284f to your computer and use it in GitHub Desktop.
config bind9 steps
1: sudo apt-get install bind9 dnsutils -y
2: cd /etc/bind/
3: mkdir zones
4: cp db.local zones/your_domain_name.com
5: nano named.conf.default-zones
6: put in the named.conf.default-zones this code :
// prime the server with knowledge of the root servers
zone "." {
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 "your_domain_name.com" {
type master;
file "/etc/bind/zones/your_domain_name.com";
};
7: save file and exit
8: nano zones/your_domain_name.com or .com or evrything
9: and put this codes in file :
;
; BIND data file for local loopback interface
;
$TTL 604800
@ IN SOA ns1.your_domain_name.com. root.your_domain_name.com. (
2 ; Serial
3600 ; Refresh
7200 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS ns1.your_domain_name.com.
@ IN NS ns2.your_domain_name.com.
@ IN A server_ip
ns1 IN A server_ip
ns2 IN A server_ip
www IN A server_ip
10: named-checkconf named.conf.default-zones
11: service bind9 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment