types of virtual hosting - wordpress.com€¦ · virtual hosting – ip based dns server linux...

62

Upload: ledang

Post on 16-May-2018

235 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254
Page 2: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Types of Virtual Hosting

• Name based

• IP based

• Port based

Page 3: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – Name based

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1client2

192.168.0.1

WebServer www.zoom.com

192.168.0.254

WindowsClient

192.168.0.2

www.ibm.com

Page 4: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – IP based

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1client2

192.168.0.1

WebServer www.zoom.com

192.168.0.254

WindowsClient

192.168.0.2

www.google.com

192.168.0.252

Page 5: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – Port based

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1client2

192.168.0.1

WebServer www.zoom.com

192.168.0.254

WindowsClient

192.168.0.2

www.redhat.com5000

Page 6: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Requirements

• Packages

httpd-2.0.52-9.ent.i386.rpm

httpd-devel-2.0.52-9.ent.i386.rpm

httpd-manual-2.0.52-9.ent.i386.rpm

httpd-suexec-2.0.52-9.ent.i386.rpm

• Port Numbers

80 Http

• Configuration File

/etc/httpd/conf/httpd.conf

• Service

httpd

• Daemon

httpd

Page 7: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – Name Based Configuration

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1 client2192.168.0.1

WebServer

192.168.0.254

WindowsClient

192.168.0.2

www.zoom.com

www.ibm.com

Page 8: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – IP based Configuration

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1client2

192.168.0.1

WebServer www.zoom.com

192.168.0.254

WindowsClient

192.168.0.2

www.google.com

192.168.0.252

Page 9: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Virtual Hosting – Port based Configuration

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1client2

192.168.0.1

WebServer www.zoom.com

192.168.0.254

WindowsClient

192.168.0.2

www.redhat.com5000

Page 10: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring HTTP Server

Install the package by using one of the installation methods

[root@comp1 ~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt

[root@comp1 ~]# cd /mnt

[root@comp1 ~]# rpm -ivh httpd* --force --aid

Open configuration for editing

[root@comp1~]# vi etc/httpd/conf/httpd.conf

Page 11: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/httpd/conf/httpd.conf

Add the below lines

NameVirtualHost *:80

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/html

ServerName www.zoom.com

DirectoryIndex zoom.html

</VirtualHost>

<VirtualHost *:80>

ServerAdmin [email protected]

DocumentRoot /var/www/html

ServerName www.ibm.com

DirectoryIndex ibm.html

</VirtualHost>

Page 12: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Server

To restart the HTTP services

[root@comp1 ~]# service httpd restart

Page 13: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS on Client

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 14: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Linux

Accessing Webserver

• Open ‘Mozilla’ or ‘Fire Fox’ browser.

• In the address box type ‘http://www.zoom.com’ and

‘http://www.ibm.com’

Page 15: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Windows

Accessing Webserver

• Open ‘Internet Explorer’ or ‘Netscape Navigator’ browser.

• In the address box type ‘http://www.zoom.com’ and

‘http://www.ibm.com’

Page 16: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring HTTP Server

Assinging Virtual IP address

[root@comp1 ~]# netconfig --device eth0:1

[root@comp1 ~]# service network restart

Open configuration for editing

[root@comp1 ~]# vi etc/httpd/conf/httpd.conf

Page 17: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/httpd/conf/httpd.conf

Add the below lines

<VirtualHost 192.168.0.252:80>

ServerAdmin [email protected]

DocumentRoot /var/www/html

ServerName www.google.com

DirectoryIndex google.html

</VirtualHost>

Page 18: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Server

To restart the HTTP services

[root@comp1 ~]# service httpd restart

Page 19: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS on Client

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 20: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Linux

Accessing Webserver

• Open ‘Mozilla’ or ‘Fire Fox’ browser.

• In the address box type ‘http://www.google.com’ or

‘http://192.168.0.252’

Page 21: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Windows

Accessing Webserver

• Open ‘Internet Explorer’ or ‘Netscape Navigator’ browser.

• In the address box type ‘http://www.google.com’ or

‘http://192.168.0.252’

Page 22: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring HTTP Server

Open configuration for editing

[root@comp1 ~]# vi etc/httpd/conf/httpd.conf

Page 23: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/httpd/conf/httpd.conf

Add the below lines

LISTEN 5000

<VirtualHost 192.168.0.253:5000>

ServerAdmin [email protected]

DocumentRoot /var/www/html

ServerName www.redhat.com

DirectoryIndex redhat.html

</VirtualHost>

Page 24: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Server

To restart the HTTP services

[root@comp1 ~]# service httpd restart

Page 25: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS on Client

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 26: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Linux

Accessing Webserver

• Open ‘Mozilla’ or ‘Fire Fox’ browser.

• In the address box type ‘http://www.redhat.com:5000’ or

‘http://192.168.0.254:5000’

Page 27: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

HTTP Client – Windows

Accessing Webserver

• Open ‘Internet Explorer’ or ‘Netscape Navigator’ browser.

• In the address box type ‘http://www.redhat.com:5000’ or

‘http://192.168.0.254:5000’

Page 28: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.zoom.com

Page 29: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

How Web Server works ?

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1 client2192.168.0.1

192.168.0.253server

192.168.0.254www

192.168.0.254server2

ibm.comForward zone

Forward zone

server

www

server2

192.168.0.253

192.168.0.254

192.168.0.254

zoom.com www 192.168.0.254

I’m lo

oking fo

r

www.zoom.co

m

Here’s a

ddress o

f

www.zoom.co

m

192.16

8.0.25

4

WebServer

192.168.0.254

Web Request for

www.zoom.com

Web Reply from

www.zoom.com WindowsClient

192.168.0.2

www.zoom.com

www.ibm.com

Page 30: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.zoom.com

Page 31: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.ibm.com

Page 32: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

How Web Server works ?

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1 client2192.168.0.1

192.168.0.253server

192.168.0.254www

192.168.0.254server2

ibm.comForward zone

Forward zone

server

www

Server2

192.168.0.253

192.168.0.254

192.168.0.254

zoom.com

www 192.168.0.254

I’m lo

oking fo

r

www.ibm.com

Here’s a

ddress o

f

www.ibm.com

192.16

8.0.25

4

WebServer

192.168.0.254

Web Request for

www.ibm.com

Web Reply from

www.ibm.com WindowsClient

192.168.0.2

www.zoom.com

www.ibm.com

Page 33: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.ibm.com

Page 34: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.google.com

Page 35: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

How Web Server works ?

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1 client2192.168.0.1

192.168.0.253server

192.168.0.252www

192.168.0.252server2

google.comForward zone

Forward zone

server

www

Server2

192.168.0.253

192.168.0.254

192.168.0.254

zoom.com

www 192.168.0.252

I’m lo

oking fo

r

www.google.com

Here’s a

ddress o

f

www.google.com

192.16

8.0.25

2

WebServer

192.168.0.254

Web Request for

www.google.com

Web Reply from

www.google.com WindowsClient

192.168.0.2

www.zoom.com

www.ibm.com

192.168.0.252

Page 36: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.google.com

Page 37: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.redhat.com:5000

Page 38: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

How Web Server works ?

DNS Server

LinuxClient

192.168.0.253

ZOOM.COM

server

client1 client2192.168.0.1

192.168.0.253server

192.168.0.254www

192.168.0.254server2

redhat.comForward zone

Forward zone

server

www

Server2

192.168.0.253

192.168.0.254

192.168.0.254

zoom.com

www 192.168.0.254

I’m lo

oking fo

r

www.redhat.c

om

Here’s a

ddress o

f

www.redhat.c

om

192.16

8.0.25

4

WebServer

192.168.0.254

Web Request for

www.redhat.com:5000

Web Reply from

www.redhat.com:5000 WebClient

192.168.0.2

www.zoom.com

www.redhat.com5000

Page 39: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

http://www.redhat.com:5000

Page 40: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server

Install the package by using one of the installation methods

[root@comp1~]# mount 192.168.0.250:/var/ftp/pub/RedHat/RPMS/ /mnt

[root@comp1 ~]# cd /mnt

[root@comp1 ~]# rpm -ivh bind* caching* --force --aid

Open configuration for editing

[root@comp1~]# vi /etc/named.conf

Page 41: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/named.conf

To change the options

zone "zoom.com" IN {

type master;

file “zoom.for";

};

zone “ibm.com" IN {

type master;

file “ibm.for";

};

Page 42: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring Forward Lookup

Copying Forward lookup zone file

[root@comp1 ~]# cd /var/named/chroot/var/named/

[root@comp1 named]# cp localhost.zone zoom.for

Open configuration for editing

[root@comp1 named]# vi zoom.for

Page 43: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/var/named/chroot/var/named/zoom.for

To add the options

$TTL 86400

@ IN SOA server.zoom.com. root.zoom.com.(

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS server.zoom.com.

server IN A 192.168.0.253

server2 IN A 192.168.0.254

www IN CNAME server2

Page 44: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring Forward Lookup

Copying Forward lookup zone file

[root@comp1 ~]# cd /var/named/chroot/var/named/

[root@comp1 named]# cp localhost.zone ibm.for

Open configuration for editing

[root@comp1 named]# vi ibm.for

Page 45: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/var/named/chroot/var/named/ibm.for

To add the options

$TTL 86400

@ IN SOA server.ibm.com. root.ibm.com.(

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS server.ibm.com.

server IN A 192.168.0.253

server2 IN A 192.168.0.254

www IN CNAME server2

Page 46: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server IP address

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 47: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

DNS Server

To restart the DNS services

[root@comp1 ~]# service named restart

Page 48: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Checking from DNS Server

Checking Forward Lookup

[root@comp1 ~]# dig www.zoom.com

[root@comp1 ~]# dig www.ibm.com

Checking Name resolution

[root@comp1 ~]# ping www.zoom.com

[root@comp1 ~]# ping www.ibm.com

Page 49: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server

Open configuration for editing

[root@comp1~]# vi /etc/named.conf

Page 50: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/named.conf

To add the below lines

zone “google.com" IN {

type master;

file “google.for";

};

Page 51: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring Forward Lookup

Copying Forward lookup zone file

[root@comp1 ~]# cd /var/named/chroot/var/named/

[root@comp1 named]# cp localhost.zone google.for

Open configuration for editing

[root@comp1 named]# vi google.for

Page 52: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/var/named/chroot/var/named/google.for

To add the options

$TTL 86400

@ IN SOA server.google.com. root.google.com.(

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS server.google.com.

server IN A 192.168.0.253

server2 IN A 192.168.0.252

www IN CNAME server2

Page 53: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server IP address

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 54: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

DNS Server

To restart the DNS services

[root@comp1 ~]# service named restart

Page 55: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Checking from DNS Server

Checking Forward Lookup

[root@comp1 ~]# dig www.google.com

Checking Name resolution

[root@comp1 ~]# ping www.google.com

Page 56: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server

Open configuration for editing

[root@comp1~]# vi /etc/named.conf

Page 57: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/etc/named.conf

To add the below lines

zone “redhat.com" IN {

type master;

file “redhat.for";

};

Page 58: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring Forward Lookup

Copying Forward lookup zone file

[root@comp1 ~]# cd /var/named/chroot/var/named/

[root@comp1 named]# cp localhost.zone redhat.for

Open configuration for editing

[root@comp1 named]# vi redhat.for

Page 59: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

/var/named/chroot/var/named/redhat.for

To add the options

$TTL 86400

@ IN SOA server.redhat.com. root.redhat.com.(

42 ; serial (d. adams)

3H ; refresh

15M ; retry

1W ; expiry

1D ) ; minimum

IN NS server.redhat.com.

server IN A 192.168.0.253

server2 IN A 192.168.0.254

www IN CNAME server2

Page 60: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Configuring DNS Server IP address

Open configuration for editing

[root@comp1 ~]# vi /etc/resolv.conf

Add the DNS server IP address in file /etc/resolv.conf

nameserver 192.168.0.253

Page 61: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

DNS Server

To restart the DNS services

[root@comp1 ~]# service named restart

Page 62: Types of Virtual Hosting - WordPress.com€¦ · Virtual Hosting – IP based DNS Server Linux Client 192.168.0.253 ZOOM.COM server client1 client2 192.168.0.1 Web Server 192.168.0.254

Checking from DNS Server

Checking Forward Lookup

[root@comp1 ~]# dig www.redhat.com

Checking Name resolution

[root@comp1 ~]# ping www.redhat.com