DNS

Domain Name System (DNS)

[root@localhost ~]#yum -y install bind*

[root@localhost ~]#cd /media/RHEL_6.1\ i386\ Disc\ 1/Packages/

[root@localhost ~]#rpm -ivh vsftpd-2.2.2-6.el6_0.1.i686.rpm

[root@localhost ~]#service vsftpd start

[root@localhost ~]#chkconfig vsftpd on

[root@localhost ~]#chkconfig –list vsftpd

[root@localhost ~]#rpm -ivh deltarpm-3.5-0.5.20090913git.el6.i686.rpm python-deltarpm-3.5-0.5.20090913git.el6.i686.rpm

[root@localhost ~]#rpm -ivh createrepo-0.9.8-4.el6.noarch.rpm

[root@localhost ~]#cd /var/ftp/pub

[root@localhost ~]#cp -ivr /media/RHEL_6.1\ i386\ Disc\ 1/* /var/ftp/pub

[root@localhost ~]#vim /etc/yum.repos.d/vijay.repo

[VijayRepo]

name=this is my repo

baseurl=ftp://192.168.211.134/pub

enabled=1

gpgcheck=0

[root@localhost ~]#createrepo /var/ftp/pub

[root@localhost ~]#yum -y install bind*

[root@localhost ~]# vi /etc/hosts

[root@localhost named]# hostname

masterdns.ostlocal.com

[root@localhost named]#

[root@localhost named]# vi /etc/named.conf

options {

listen-on port 53 { 127.0.0.1; 192.168.211.134; };

listen-on-v6 port 53 { ::1; };

directory       “/var/named”;

dump-file       “/var/named/data/cache_dump.db”;

statistics-file “/var/named/data/named_stats.txt”;

memstatistics-file “/var/named/data/named_mem_stats.txt”;

allow-query     { localhost; 192.168.211.134; };

recursion yes;

dnssec-enable yes;

dnssec-validation yes;

dnssec-lookaside auto;

/* Path to ISC DLV key */

bindkeys-file “/etc/named.iscdlv.key”;

};

[root@localhost named]# cd /var/named/chroot/var/named/

[root@localhost named]#

[root@localhost named]#cp -rvpf named.* chroot/var/named/

[root@localhost named]#cp -rvpf data chroot/var/named/

[root@localhost named]#cp -rvpf dynamic chroot/var/named/

[root@localhost named]#cp -rvpf slaves chroot/var/named/

[root@localhost named]#chroot/var/named/

cp -rvpf named.* /var/named/chroot/etc/

[root@localhost named]#cd /var/named/chroot/etc/

[root@localhost etc]# vi named.conf

[root@localhost etc]#named-checkconf named.conf

[root@localhost etc]#echo $?

[root@localhost etc]#vim /etc/resolv.conf

[root@localhost etc]# vim named.rfc1912.zones

# Forward Lookup zone #

zone “ostlocal.com” IN {

type master;

file “ostlocal.com.zone”;

allow-update { none; };

};

# Reverse Lookup Zone

zone “211.168.192.in-addr.arpa” IN {

type master;

file “192.168.211.zone”;

allow-update { none; };

};

root@localhost etc]# cd ../var/named/

[root@localhost named]#

[root@localhost named]#cp –rvpf named.localhost ostlocal.com.zone

[root@localhost named]#cp -rvpf named.localhost ostlocal.com.zone

[root@localhost named]#cp -rvpf named.loopback 192.168.211.zone

[root@localhost named]# pwd

/var/named/chroot/var/named

[root@localhost named]# vim ostlocal.com.zone

79  vim ostlocal.com.zone

$TTL 1D

@       IN SOA  ostlocal.com. hostmaster.ostlocal.com. (

0       ; serial

1D      ; refresh

1H      ; retry

1W      ; expire

3H )    ; minimum

IN NS               ostlocal.com.

IN A                192.168.211.134

masterdns   IN CNAME            ostlocal.com.

ostlocal.com.   IN MX   10 mail.ostlocal.com.

[root@localhost named]# named-checkzone masterdns.ostlocal.com ostlocal.com.zone

ostlocal.com.zone:11: ignoring out-of-zone data (ostlocal.com)

zone masterdns.ostlocal.com/IN: loaded serial 0

OK

[root@localhost named]#

[root@localhost named]# vim 192.168.211.zone

$TTL 1D

@       IN SOA  ostlocal.com. hostmaster.ostlocal.com. (

0       ; serial

1D      ; refresh

1H      ; retry

1W      ; expire

3H )    ; minimum

IN NS   ostlocal.com.

134     IN PTR  ostlocal.com.

[root@localhost named]# named-checkzone 192.168.211.134 192.168.211.zone

zone 192.168.211.134/IN: loaded serial 0

OK

[root@localhost named]#

[root@localhost named]# service named restart

Stopping named:                                            [  OK  ]

Starting named:                                            [  OK  ]

[root@localhost named]#

[root@localhost named]# nslookup masterdns.ostlocal.com

Server:                 192.168.211.2

Address:              192.168.211.2#53

Non-authoritative answer:

Name:  masterdns.ostlocal.com

Address: 218.93.250.18

[root@localhost named]#

[root@localhost named]# dig -x 192.168.211.134

;; Warning: Message parser reports malformed message packet.

; <<>> DiG 9.7.3-RedHat-9.7.3-2.el6 <<>> -x 192.168.211.134

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 30450

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;134.211.168.192.in-addr.arpa.   IN           PTR

;; ANSWER SECTION:

168.192.in-addr.arpa.     5              IN           SOA       prisoner.iana.org. hostmaster.root-servers.org. 1 604800 60 604800 604800

;; Query time: 135 msec

;; SERVER: 192.168.211.2#53(192.168.211.2)

;; WHEN: Sun Aug 20 16:43:00 2017

;; MSG SIZE  rcvd: 123

[root@localhost named]#

[root@localhost named]# vim ostlocal.com.zone

$TTL 1D

@       IN SOA  ostlocal.com. hostmaster.ostlocal.com. (

0       ; serial

1D      ; refresh

1H      ; retry

1W      ; expire

3H )    ; minimum

IN NS               ostlocal.com.

IN A                192.168.211.134

masterdns   IN CNAME            ostlocal.com.

ostlocal.com.   IN MX   10 mail.ostlocal.com.

[root@localhost named]# named-checkzone mail.example.com ostlocal.com.zone

ostlocal.com.zone:11: ignoring out-of-zone data (ostlocal.com)

zone mail.example.com/IN: loaded serial 0

OK

[root@localhost named]#

[root@localhost named]# service named restart

Stopping named: .                                          [  OK  ]

Starting named:                                            [  OK  ]

[root@localhost named]#

[root@localhost named]# dig ostdoamin.com MX

;; Warning: Message parser reports malformed message packet.

; <<>> DiG 9.7.3-RedHat-9.7.3-2.el6 <<>> ostdoamin.com MX

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56827

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:

;ostdoamin.com.                                              IN           MX

;; ANSWER SECTION:

com.                                      5              IN           SOA       a.gtld-servers.net. nstld.verisign-grs.com. 1503257824 1800 900 604800 86400

;; Query time: 2029 msec

;; SERVER: 192.168.211.2#53(192.168.211.2)

;; WHEN: Sun Aug 20 16:46:24 2017

;; MSG SIZE  rcvd: 104

[root@localhost named]#