Introduction:-
The DNS translates Internet domain and host names to IP addresses. DNS automatically converts the names we type in our Web browser address bar to the IP addresses of Web servers hosting those sites. Domain Name System to determine the IP address associated with a domain name. This process is also known as forward DNS resolution. Reverse DNS lookup is the inverse process, the resolution of an IP address to its designated domain name.
Requirement:-
Package = bind, caching, httpd
Service = named, httpd
Port no. = 53 – DNS, 80 – HTTP
Configuration file = /etc/named.caching-nameserver.conf
/etc/named.rfc1912.zones
/etc/httpd/conf/httpd.conf
Per quest:-
Configure Server IP - 192.168.1.1
Configure Virtual IP – 192.168.1.10 & 192.168.1.20
Configure Server Hostname – server.rootuser.in
Configure DNS Server:-
1] Install required packages for DNS.
2] Edit main configuration file of DNS.
listen-on port 53 { 127.0.0.1; 192.168.1.1;};
allow-query { none; 192.168.1.0/24;};
match-clients { none; 192.168.1.0/24;};
:wq
3] Add the website zone in rfc1912.zones file.
#Go to end of the file and type as follows.
zone “rootuser.in” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};
zone “anup.com” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};
zone “shubham.com” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};
zone “1.168.192.in-addr.arpa” IN {
type master;
file “named.local”;
allow-update { none; };
};
:wq
4] Now configure zone files.
[root@server named]# cp localhost.zone localhost.zone.backup $TTL 86400
@ SOA server.rootuser.in. root (
42 ; serial
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
IN NS server.rootuser.in.
rootuser.in IN A 192.168.1.1
www.anup.com IN A 192.168.1.10
www.shubham.com IN A 192.168.1.20
:wq
$TTL 86400
@ SOA server.rootuser.in. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expiry
86400 ) ; Minimum
IN NS server.rotuser.in.
1 IN PTR server.rootuser.in.
10 IN PTR www.anup.com.
20 IN PTR www.shubham.com.
:wq
5] Set primary DNS server.
nameserver 192.168.1.1
:wq
6] Start named service.
7] Use following command to test DNS server.
Configure Aapche Web Server:-
8] Now install packeges for apache web server.
9] Edit & Append the following line in httpd.conf file.
#Name VirtualHosts *:80 --> Name VirtualHosts 192.168.1.1:80
#Go to end of file.
<VirtualHost 192.168.1.1:80>
ServerAdmin root@server.rootuser.in
DocumentRoot /var/www/html/rootuser.in
ServerName server.rootuser.in
DirectoryIndex index.html
</VirtualHost>
<VirtualHost 192.168.1.1:80>
ServerAdmin root@server.rootuser.in
DocumentRoot /var/www/html/anup.com
ServerName www.anup.com
DirectoryIndex index.html
</VirtualHost>
<VirtualHost 192.168.1.1:80>
ServerAdmin root@server.rootuser.in
DocumentRoot /var/www/html/shubham.com
ServerName www.shubham.com
DirectoryIndex index.html
</VirtualHost>
:wq
10] Create web pages for website.
[root@server html]# mkdir rootuser.in anup.com shubham.com <b><font size=15 color=orange><center>This is Rootuser.in</center></font></b>
^+d
<b><font size=15 color=blue><center>This is Anup.com</center></font></b>
^+d
<b><font size=15 color=green><center>This is Shubham.com</center></font></b>
^+d
11] Start httpd service.
12] Point your Web Browser to following URL.
http://server.rootuser.in
http://www.anup.com
http://www.shubham.com