Professional Documents
Culture Documents
Configuring Dns Server On Redhat 5 DNS TRI Partie 1
Configuring Dns Server On Redhat 5 DNS TRI Partie 1
Configuring Dns Server On Redhat 5 DNS TRI Partie 1
bind-chroot-9.3.6-4.P1.el5
bind-libs-9.3.6-4.P1.el5
ypbind-1.19-12.el5
bind-9.3.6-4.P1.el5
bind-utils-9.3.6-4.P1.el5
bind-sdb-9.3.6-4.P1.el5
bind-devel-9.3.6-4.P1.el5
bind-libbind-devel-9.3.6-4.P1.el5
system-config-bind-4.0.3-4.el5
Caching-nameserver-9.3.6-4.P1.el5
If not installed, then installed the packages using Yum command:
[root@ns1 ~]# Yum Install bind* caching-nameserver*
(Original File):
#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
After changing you have to reload/restart the NIC(eth0) card by following command:
Step-3: After complete the NIC configure you have to change the host name by following this command:
[root@ns1 ~]# gedit /etc/sysconfig/network
(Original File):
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=localhost.localdomain
(Modified File):
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=SRV
Step-4: Now Edit hosts file for host name resolution by following this command:
[root@ns1 ~]# gedit /etc/hosts
(Original File):
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
(Modified File):
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.10 srv.tmsir.ma srv
Step-5: Copy & Rename the named.rfc1912.zones file to named.conf file & Change the ownership &
permission by following this command:
[root@ns1 ~]# cd /var/named/chroot/etc
[root@ns1 etc]# cp named.caching-nameserver.conf named.conf
[root@ns1 etc]# chown root:named named.conf
[root@ns1 etc]# chmod 777 named.conf
//
// named.caching-nameserver.conf
//
// Provided by Red Hat caching-nameserver package to configure the
// ISC BIND named(8) DNS server as a caching only nameserver
// (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
// DO NOT EDIT THIS FILE - use system-config-bind or an editor
// to create named.conf - edits to this file will be lost on
// caching-nameserver package upgrade.
//
options {
listen-on port 53 { 127.0.0.1; };
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; };
allow-query-cache { localhost; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
view localhost_resolver {
match-clients { localhost; };
match-destinations { localhost; };
recursion yes;
include "/etc/named.rfc1912.zones";
};
allow-query { localhost;192.168.1.0/24; };
allow-query-cache { localhost;192.168.1.0/24; };
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
//view localhost_resolver {
//match-clients { localhost; };
//match-destinations { localhost; };
//recursion yes;
//include "/etc/named.rfc1912.zones";
//};
zone "tmsir.ma" IN {
type master;
file "tmsir.zone";
//allow-update { 192.168.1.10; };
};
zone "1.168.192.in-addr.arpa" IN {
type master;
file "tmsir.rev";
//allow-update { 192.168.1.10; };
};
Step-6: Copy, rename & change the ownership & permission of localhost.zone file for Forward lookup
zone.
[root@ns1 ~]# cd /var/named/chroot/var/named/
[root@ns1 named]# cp localhost.zone tmsir.zone
[root@ns1 named]# chown root:named tmsir.zone
[root@ns1 named]# chmod 777 tmsir.zone
[root@ns1 named]# gedit tmsir.zone
Modified File: tmsir.zone
$TTL 86400
@ IN SOA srv.tmsir.ma. root.tmsir.ma. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN A 127.0.0.1
IN AAAA ::1
@ IN NS srv.tmsir.ma.
srv.tmsir.ma. IN A 192.168.1.10
pc1.tmsir.ma. IN A 192.168.1.11
pc2.tmsir.ma IN A 192.168.1.12
MONSERVEURWEB .TMSIR.MA IN A 192.168.1.30
Step-7: copy & rename the alphabd.fz file for Reverse lookup zone.
[root@ns1 named]# cp tmsir.zone tmsir.rev
[root@ns1 named]# gedit tmsir.rev
Original File: tmsir.rev
$TTL 86400
@ IN SOA srv.tmsir.ma. root.tmsir.ma. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN A 127.0.0.1
IN AAAA ::1
@ IN NS srv.tmsir.ma.
srv.tmsir.ma. IN A 192.168.1.10
pc1.tmsir.ma. IN A 192.168.1.11
pc2.tmsir.ma IN A 192.168.1.12
Modified File: tmsir.rev
$TTL 86400
@ IN SOA srv.tmsir.ma. root.tmsir.ma. (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN A 127.0.0.1
IN AAAA ::1
@ IN NS srv.tmsir.ma.
10 IN PTR srv.tmsir.ma.
11 IN PTR pc1.tmsir.ma.
12 IN PTR pc2.tmsir.ma.
search tmsir.ma
nameserver 192.168.1.10
Step-10: DNS check
[root@ns1 ~]# service iptables stop
[root@ns1 ~]# service network restart
[root@ns1 ~]# chkconfig named on
[root@ns1 ~]# service named restart /status /start /stop /configtest
[root@ns1 ~]# host 192.168.1.10
[root@ns1 ~]# host srv.tmsir.ma
[root@ns1 ~]# Ping srv.tmsir.ma
[root@ns1 ~]# nslookup srv.tmsir.ma
[root@ns1 ~]# nslookup 192.168.1.10
[root@ns1 ~]# dig srv.tmsir.ma
[root@ns1 ~]# dig –x 192.168.1.10
[root@ns1 ~]# dig –x srv.tmsir.ma
[root@ns1 ~]# dig –t SOA tmsir.ma
[root@ns1 ~]# dig –t axfr tmsir.ma