Tuesday, August 24, 2010

Live DNS Setup

########## LIVE DNS SETUP WITH WEB SERVER ###############

1)hostname configuretion file.

#vim /etc/sysconfig/network



2)To assign hostname temp.

#hostname server1.example.com



3)To install packages.

#rpm -ivh bind* --force --aid

#rpm -ivh caching-nameserver-9.3.3-7.el5.i386.rpm



4)DNS configuretion file



#vim /var/named/chroot/etc/named.conf



options {

directory "/var/named";

};





zone "example.com" IN {

type master;

file "example.for";

};



zone "0.168.192.in-addr.arpa" IN {

type master;

file "example.rev";

};





5)Go into this path.

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



6)Copy the file

#cp localhost.zone example.for



7)Copy the file

#cp named.local example.rev



8)To change the owenership.

#chown named.named example*



9)To configure the file(.for)

#vim example.for



$TTL 86400

@ IN SOA server1.example.com. root (

                                                          42 ; serial (d. adams)

                                                          3H ; refresh

                                                          15M ; retry

                                                          1W ; expiry

                                                          1D ) ; minimum



IN       NS      server1.example.com.


server1     IN    A   192.168.0.1

server2     IN    A   192.168.0.2

server3     IN    A   192.168.0.3 --------> (windows machine)

www        IN    CNAME   server1





10)To configure the file(.rev)

#vim example.rev



$TTL 86400

@ IN SOA server1.example.com.                               root.server1.example.com. (

                                                                                   1997022700 ; Serial

                                                                                   28800 ; Refresh

                                                                                   14400 ; Retry

                                                                                   3600000 ; Expire

                                                                                   86400 ) ; Minimum

IN     NS     server1.example.com.



1       IN      PTR     server1.example.com.

2       IN      PTR     server2.example.com.





11)To configure the file.

#vim /etc/resolv.conf

nameserver 192.168.0.6



12)To restart the srvice.

#service named restart



13)To check.

#host server1.example.com

server1.example.com has address 192.168.0.6



14)To check.

#host 192.168.0.2

2.0.168.192.in-addr.arpa domain name pointer server2.example.com.



15)client side.

#dig (server name)

#dig -x (ip)





############### WEB SERVER CONFIGURETION ####################





1)Matchine name.

#hostname server1.example.com

#vim /etc/sysconfig/network

HOSTNAME= server1.example.com



2)Matchine IP.

192.168.0.1



3)To install package.

#rpm -ivh httpd* --force



4)Open configuretion file.

#vim /etc/httpd/conf/httpd.conf



LINE NO-250

ServerAdmin root@server1.example.com



LINE NO-264

ServerName www.example.com:80

LINE NO-280

DocumentRoot "/var/www/html"

LINE NO-305


LINE NO-390

DirectoryIndex index.html index.html.var



5)To create a html file.

#vim /var/www/html/index.html



6)To restart the service.

#service httpd restart



7)To open the file.

# vim /etc/hosts

192.168.0.253 www.example.com



8)To check the page.

open the firefox & check.



###############################################################



From windows client machine.

Machine Name --> server3

My network place --> Property --> Tcp/IP --> Property --> DNS 192.168.0.2
 
##################### END #####################################