Department of Engineering Sceince DNS Configuration in Linux - 1

Document Sample
Department of Engineering Sceince DNS Configuration in Linux - 1 Powered By Docstoc
					Department of Engineering Sceince                                                                     DNS Configuration in Linux




                                                                    CONTENTS



1.   OBJECTIVE ..................................................................................................................................... 2
2.   DNS ..................................................................................................................................................... 2
3.   EXERCISE ........................................................................................................................................ 2
4.   SOLUTION ....................................................................................................................................... 3
5.   REFERENCES.................................................................................................................................. 6
6.   APPENDIX ....................................................................................................................................... 6




                                                                                                                                                - 1 of 6 -
Department of Engineering Sceince                          DNS Configuration in Linux




1.   Objective

     Upon completion of this lab, you should be able to:

        Identify the files that need to be modified to configure DNS

        Create necessary files for domain lookup

        Start/Stop named service (DNS)

        Test DNS configuration


2.   DNS

Domain Name System is used for converting host names and domain names into IP

addresses on the Internet or on local networks that use the TCP/IP protocol. For

example, when a Web site address is given to the DNS either by typing a URL in a

browser or behind the scenes from one application to another, DNS servers return

the IP address of the server associated with that name.


3.   Exercise

The goal of this exercise is to configure a DNS server which can resolve domain

names to IP addresses and vice versa (reverse lookup).

Configure your DNS server to resolve the domain names and servers listed below



Domain Name:           dns<HD>.com Ex: dn10.com

Web Server:            www.dns<HD>.com Ex: www.dns10.com

Mail Server:           mail.dns<HD>.com Ex: mail.dns10.com

IP Address:            192.168.0.<HD> Ex: 192.168.0.10




                                                                             - 2 of 6 -
Department of Engineering Sceince               DNS Configuration in Linux



4.   Solution

      Log in as the ‘root’ user

      Check if DNS server module is installed on your machine

          Go to Desktop  System Settings  Add/Remove Applications

          DNS Server should be listed in the list of available

           applications.

          If DNS server is not installed, please install DNS Server

           module. (You will need the Fedora Core 4 installation CDs for

           performing this step)

      Open a terminal window

      Check if the folder /var/named/chroot/etc exists

           #    ls -l /var/named/chroot/etc

           If the folder doesn’t exist, make sure the DNS packages are

           installed.

      Change directory to /var/named/chroot/etc.

           #    cd /var/named/chroot/etc

      List file with name ‘named.conf’

           #    ls –l named.conf

      Take a back up of ‘named.conf’

           #    cp named.conf named.conf.BAK

      Open ‘named.conf’ file in the editor of your choice

           #    vi named.conf

           Note: Those who are not comfortable with ‘vi’ use your

           favorite editor




                                                                    - 3 of 6 -
Department of Engineering Sceince                 DNS Configuration in Linux




    Add the following entries to ‘named.conf’ file

       before include “/etc/rndc.key”

       zone “dns10.com” IN {

                type master;

                file “named.dns10.com”;

                allow-update { none; };

       };

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

                type master;

                file “named.0.168.192”;

                allow-update { none; };

       };

       Note: ‘dns10’ is an example. Where ‘10’ is the hard drive number.
               Use your hard drive number while choosing a domain name

    Save the file with the changes.

    Check if ‘named.conf’ file has the changes you made

            #   cat named.conf

       Change directory to /var/named/chroot/var/named

            #   cd /var/named/chroot/var/named

    Create a file with name “named.dns10.com”

            #   touch named.dns10.com

   Note: ‘dns10’ is an example. Where ‘10’ is the hard drive number.

    Create a file with name “named.0.168.192”

            #   touch named.0.168.192

    Add the following to ‘named.dns10.com” and save the file

   $TTL 86400
   @       IN         SOA   web10.dns10.com. admin.dns10.com. (
                                        2002072100 ; Serial
                                        28800 ; Refresh
                                        14400 ; Retry

                                                                    - 4 of 6 -
Department of Engineering Sceince                 DNS Configuration in Linux


                                        3600000 ; Expire
                                        86400) ; Minimum
              IN   NS    web10
              IN   A     192.168.0.10
   mail       IN   A     192.168.0.10
   www        IN   A     192.168.0.10

   Note: Use IP address and your host name wherever applicable. This is
   just an example

    Add the following to ‘named.0.168.192”       and save the file

   $TTL 86400
   @       IN      SOA   web10.dns10.com. admin.dns10.com. (
                                     2002072100 ; Serial
                                     28800 ; Refresh
                                     14400 ; Retry
                                     3600000 ; Expire
                                     86400) ; Minimum
              IN   NS    web10
   10         IN   PTR   web10.dns10.com
   10         IN   PTR   www.dns10.com

   Note:
   Use IP address and your host name wherever applicable. This is just
   an example.
   ‘10’ displayed in the first column is the last octet of your IP
   address. Do not use format like ‘05’ if the last octet of your IP
   address is ‘5’.

    DNS Client configuration. Modify /etc/resolv.conf file

             Change directory to /etc

          #   cd /etc

             Edit resolv.conf

          #   vi resolv.conf

             Add the following entries and save the file

              nameserver 192.168.0.10

    Open a new terminal

    Stop the DNS service by using the following command

          #   service named stop

    Start the DNS service       by using the following command

          #   service named start

    Test DNS configuration using the following commands


                                                                      - 5 of 6 -
Department of Engineering Sceince                 DNS Configuration in Linux


           #    ping dns10.com

                Use ‘Ctrl-C’ to stop it.

           #    ping www.dns10.com

           #    ping mail.dns10.com

           #    host 192.168.0.10

           #    dig dns10.com

     All the above commands should return valid responses if the entire

     configurations are connect.

     Note: Restart DNS server using commands mentioned after any changes

     to DNS related files.


5.   References

http://www.answers.com/topic/domain-name-system


6.   Appendix




                                                                    - 6 of 6 -

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:0
posted:10/6/2011
language:English
pages:6