Master Server
INSTALLING BIND
######## ON Cent OS 7##################
yum install bind bind-utils bind-chroot
systemctl enable named
systemctl start named
#change lines as following
listen-on port 53 {any;};
listen-on-v6 port 53 {none;};
allow-query {any;};
#after configuring
named-checkconf
systemctl reload named
#define zone on /etc/named.conf as bellow
zone "iran.ir" {
type master;
file "iran.ir.db";
};
#after configuring
cp $(rpm -qa bind | grep localhost | head -1) /var/named/iran.ir.db
#configuring /var/named/iran.ir.db as bellow
$TTL 1D
@ IN SOA iran.ir. admin.iran.ir. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
ns1 A 192.168.61.143
www A 192.168.61.150
w CNAME www.iran.ir.
ww CNAME www.iran.ir.
mail1 A 192.168.61.120
@ MX 0 mail1.iran.ir.
#after configuration
named-checkzone iran.ir /var/named/iran.ir.db
systemctl reload named
#for verification
rndc flush
dig @localhost A iran.ir
######## ON Ubuntu 20.04 ##############
apt-get update && apt-get install bind9 bind9-utils
#add following line into /etc/bind/named.conf
zone "iran.ir." {
type master;
file "iran.ir.db";
};
#after add configuration to verfiy
named-checkconf
#add following line into /var/cache/bind/iran.ir.db
$TTL 1D
@ IN SOA iran.ir. admin.iran.ir. (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
ns1 A 192.168.61.143
www A 192.168.61.150
w CNAME www.iran.ir.
ww CNAME www.iran.ir.
mail1 A 192.168.61.120
@ MX 0 mail1.iran.ir.
#change user permission of iran.ir.db
chown bind:bind /var/cache/bind/iran.ir.db
#and check configuration with following command
named-checkzone iran.ir /var/cache/bind/iran.ir.db
#reload service and verfy dns service
systemctl reload named
rndc flush
dig @localhost A iran.ir
Last updated on 26 Oct 2019
Published on 23 Nov 2018