Docstoc

DNS-Lab

Document Sample
DNS-Lab Powered By Docstoc
					                       School of Computer Studies – Seneca College



    DNS – Primany DNS configuration
Name: ________________________________                 HDSN: _____________________

Student ID: ___________________ Group: ___________ Date: _____________


In this lab, you build a primary name server for your group domain using the BIND
package on current RedHat Linux CD. Primary name server does not depend upon having
access to other name server on your network.

Every group member must setup a primary name server on their hard disk, and test their
setup by pointing their resolver to their own name server.

Remove the IP-host pair of your group members' host from your /etc/hosts file. Mark sure
that you can telnet (or ssh) to your group's hosts with IP address only and not by host
name.

1.Use the command “rpm –qa | grep ^bind “ to verify whether you have the BIND
   packages installed on your hard disk. This should include bind and bind-utils
   packages. If any one of the two packages is not installed, install it now and check the
   version of each of the following packages:

    bind :                                   bind-utils:

2.Steps to configure a Primary DNS Server

    a.Stop the name server daemon “named” if it is running.
        /etc/rc.d/init.d/named stop (or service named stop)
    b.Edit /etc/resolv.conf
    c.Verify /var/named/named.ca
    d.Edit /var/named/named.local
    e.Edit/add /var/named/named.hosts
    f.Edit/add /var/named/named.rev
    g.Edit/add /etc/named.conf
    h.Start the name server daemon “named”:
        /etc/rc.d/init.d/named start (or service named start)



3.Use the command “ps –ef | grep named” to verify that “named” is not running.

4.Edit /etc/resolv.conf

    Backup or comment out the line starts with “domain”, “search”, and “nameserver”.
    Add the following line to the file:


Advanced Network administration            2003                                     OPS535
RC                                      Page 1 of 6
                        School of Computer Studies – Seneca College


        domain group-domain-name
        search group-domain-name
        nameserver ip-address-of-your-host

5.Verify /var/named/named.ca

    This file is not included in the BIND package. You can get the most up-to-date
    version of this file from ftp://ftp.rs.internic.net or install it from the caching-nameserver
    rpm package. Check the contents of this file. Record the IPs of the first three root
    name servers from the file:

        1st root name server IP: _______________________

        2nd root name server IP: _______________________

        3rd root name server IP: _______________________

6.Edit/create the file /var/named/named.local
   Sample:
       $TTL     86400
       @          IN         SOA        localhost. root.localhost.            (
                                                      1997022700 ;           Serial
                                                      28800      ;           Refresh
                                                      14400      ;           Retry
                                                      3600000    ;           Expire
                                                      86400 )    ;           Minimum
                           IN         NS      localhost.

       1             IN            PTR         localhost.

    Record your version of named.local here:




7.Edit/add /var/named/named.hosts:
   Look up the record layout for the SOA record and put the FQDN of you host and the
   root’s email address in this record.
   Put the FQDN of your host in the NS record as well.
   Look up the format for A record and add all the hosts and their IPs in your group to
   this file.

    Copy the contents of /var/named/named.hosts here




Advanced Network administration                2003                                        OPS535
RC                                          Page 2 of 6
                       School of Computer Studies – Seneca College




8.Edit/add /var/named/named.rev:
   In this file, you can have the same SOA and NS record as your named.host file.
   Look up the format for PTR record and add the PTR records for all the hosts that you
   added to the named.hosts file. Please don’t leave any space at the beginning of a PTR
   record.

    Copy the contents of your /var/named/named.rev file here:




9.Edit/add /etc/named.conf
   The BIND package includes the configuration file “named.conf” for running a
   caching only nameserver. The file has pointers to the hint file “/var/named/named.ca”
   and the local zone file “/var/named/named.local”.
   You need to add a pointer to the zone file for your group's domain:

        zone “group-domain-name” {
              Type master;
              File “named.hosts”;
        };

    You also need to add a pointer to the reverse look up file for all the hosts in your
    group domain (replace x by your pod number):
        zone “x.16.172.in-addr.arpa” {
              type master;



Advanced Network administration              2003                                     OPS535
RC                                        Page 3 of 6
                       School of Computer Studies – Seneca College

                file “named.rev”;
        };

    Add the above two stanza to your /etc/named.conf file in the proper place.

10.Start the “named” daemon (Turn on your DNS server for name lookup)
   /etc/rc.d/init.d/named start (or service named start)

    Record any message when starting up the “named” server:




11.You are now ready to try to query your name server.

    a.Enter the command “nslookup -sil ” and press ENTER. At the “>” promt”, type
       “server” and press ENTER. If your name server is working properly, you should
       get the following output:

        Default Server: xxxxxxxxxxxxx
        Address: nnn.nnn.nnn.nnn#53
        >

        From the output of the “nslookup” command,
        What is the Default Server:_____________________________________
        What is the address of the Default Server: _________________________

To display the option values stored in your nameserver,
type the command “set all” at the nslookup prompt “>”:

        What is the output from the “set all” command?




        From the above output, what is your “srchlist”?



        From the above output, what is the querytype?



Advanced Network administration            2003                                  OPS535
RC                                      Page 4 of 6
                       School of Computer Studies – Seneca College




     b.While you are still in the nslookup prompt “>”, try all the host names that you
        have included in your named.hosts file. Verify that your nameserver resolve them
        into their corresponding IP addresses.

        Host Name: __________________ IP: __________________________

        Host Name: __________________        IP: __________________________

        Host Name: __________________        IP: __________________________

12.While your name server is running, can you telnet to your group members’ machine
   by hostname?


13.Now turn off your name server, can you telnet to your group members’ machine by
   hostname?


14.While your name server is NOT running, can you telnet to your group members’
   machine by IP?

15.Once everybody has their name server running, pick one as your group's name server
   and shutdown all the other name server in your group.
   a.What file should be changed in your system so that you machine will use the new
      name server?


     b.What changes should be made to that file?




Questions:
1.While your name server is still running, reboot your machine. Is your name server still
   running after the reboot?
2.How would configure your system to turn on the name server service at runlevel 3 and
   5?

Answers:

1.




Advanced Network administration            2003                                    OPS535
RC                                      Page 5 of 6
                       School of Computer Studies – Seneca College


2.




Advanced Network administration            2003                      OPS535
RC                                      Page 6 of 6

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:5
posted:11/11/2012
language:Unknown
pages:6