0% found this document useful (0 votes)
50 views6 pages

Configuring Dns Server On Redhat 5 DNS TRI Partie 1

The document provides steps to configure a DNS server on a Red Hat 5 system. It involves installing bind packages, configuring the network interface, modifying configuration files such as named.conf and host files, creating forward and reverse lookup zones, and testing the DNS server. Key steps include editing named.conf to listen on the server's IP, define the zones, and copy sample zone files to define records; modifying resolv.conf to point to the DNS server; and restarting named and testing lookups.

Uploaded by

Ismail bilakan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views6 pages

Configuring Dns Server On Redhat 5 DNS TRI Partie 1

The document provides steps to configure a DNS server on a Red Hat 5 system. It involves installing bind packages, configuring the network interface, modifying configuration files such as named.conf and host files, creating forward and reverse lookup zones, and testing the DNS server. Key steps include editing named.conf to listen on the server's IP, define the zones, and copy sample zone files to define records; modifying resolv.conf to point to the DNS server; and restarting named and testing lookups.

Uploaded by

Ismail bilakan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

configuring dns server on redhat 5

configuring dns server on red-hat PARTIE 1

Primary DNS Server Configuration


Step- 1: Check bind and caching-nameserver rpm package is installed or not by following this command:
                       
[root@ns1 ~]# rpm -qa | grep –i bind*    or
[root@ns1 ~]#  rpm –qa bind*            (if installed then it will show all the bind related packages)

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

[root@ns1 ~]# rpm -qa caching-nameserver* 

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*

Step-2: Check and Configure the Network Card:


[root@ns1 ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0

(Original File):
#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes

(Modified File): preparation fichier caret reseau


#Broadcom Corporation Net link BCM57875 Gigabyte Ethernet PCI Express
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29: EB: B2: CA
ONBOOT=yes
TYPE=Ethernet
PEERDNS=no
USERCTL=no
IPV6INIT=no
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
BROADCAST=192.168.1.254

After changing you have to reload/restart the NIC(eth0) card by following command:

[root@ns1 ~]# ifdown eth0


[root@ns1 ~]# ifup eth0
[root@ns1 ~]# service network restart

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

Now Create A Link into /etc directory of named.conf then edit.


[root@ns1 etc]# ln –s /var/named/chroot/etc/named.conf  /etc/named.conf
[root@ns1 ~]# gedit /etc/named.conf
fichier sourece sans modification:

//
// 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";

// Those options should be used carefully because they disable port


// randomization
// query-source port 53;
// query-source-v6 port 53;

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";

};

le fichier a prés modification :


//
// 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;192.168.1.10; };
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";

// Those options should be used carefully because they disable port


// randomization
// query-source port 53;
// query-source-v6 port 53;

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

Original File:  localhost.zone


$TTL 86400
@          IN SOA     @       root (
                           42         ; serial (d. adams)
                           3H         ; refresh
                           15M        ; retry
                           1W         ; expiry
                           1D )       ; minimum
           IN NS @
          IN A       127.0.0.1
           IN AAAA         ::1

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.

Step-8:  Edit the resolv.conf file by following this command


[root@ns1 named]# vi /etc/resolv.conf

search tmsir.ma
nameserver 192.168.1.10

Step-9:    Check the named.conf & zone file by following this commands,


[root@ns1 ~]# named-checkconf  /var/named/chroot/etc/named.conf 
[root@ns1 ~]# named-checkzone  tmsir.ma  /var/named/chroot/var/named/
tmsir.zone
[root@ns1 ~]# named-checkzone  tmsir.ma   /var/named/chroot/var/named/
tmsir.rev

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

You might also like