Domain Name Service And Virtual Hosting
ÀÌ ¹®¼ÀÇ ³»¿ë¿¡ ´ëÇÑ ¹«´Ü º¹Á¦¸¦
±ÝÇÕ´Ï´Ù.
Copyright © 2002 Yoon Kyung Koo, All rights reserved.
1. DNS Resource Records
- A : a computer address - IP number
- NS : An authoritative name server - domain name for server
- CNAME : The canonical name for an alias - domain name for alias
- SOA : marks the start of data for a zone - parameters governing the
zone
- WKS : a well-known service description - list of service names and
protocols
- PTR : Domain name pointer (reverse lookups) - domain name
- HINFO : host information - machine architecture and operating system
- MX : mail exchange - list of <preference, host> pairs
- TXT : text string - arbitrary text
2. Server configuration
- resolver : DNS client
- entry : domain name, time to live, class, type, value
-
domain name
|
time to live
|
class
|
type
|
value
|
comments
|
|
1D
|
IN
|
NS
|
dns0
|
domain name server
|
|
1D
|
IN
|
NS
|
dns1
|
domain name server
|
|
1D
|
IN
|
NS
|
cancer.ucs.ed.ac.uk
|
|
|
1D
|
IN
|
MX
|
1 mail1.qmw.ac.uk
|
|
|
1D
|
IN
|
MX
|
2 mail2.qmw.ac.uk
|
|
dns0
|
1D
|
IN
|
A
|
138.37....
|
|
dns1
|
1D
|
IN
|
A
|
138.37....
|
|
www
|
1D
|
IN
|
CNAME
|
copper
|
|
copper
|
1D
|
IN
|
A
|
138.37.88.248
|
|
dcs
|
1D
|
IN
|
NS
|
dns0.dcs
|
sub domain name server
|
dns0.dcs
|
1D
|
IN
|
A
|
138.37.88.249
|
|
dcs
|
1D
|
IN
|
NS
|
dns1.dcs
|
sub domain name server
|
dns1.dcs
|
1D
|
IN
|
A
|
138.37.94.248
|
|
dcs
|
1D
|
IN
|
NS
|
cancer.ucs.ed.ac.uk
|
|
3. BIND : The Berkeley Internet Name Domain
- an implementation of the DNS
- named (server process) and resolver (client library)
- three categories of name server : primary server, secondary server,
caching-only server
4. dynamic updates on dns entry
5. wildcard domain
6. virtual hosting
7. an Apache virtual host configuration example
#
# Use name-based virtual hosting.
#
NameVirtualHost ###.###.###.###
<VirtualHost ###.###.###.###>
#primary vhost
# http://testie.test.com/blahblah => /test-domain/testie/blahblah
(URI)
ServerName *.test.com
RewriteEngine On
RewriteCond %{HTTP_HOST} [^.]+\.test\.com$
RewriteRule ^(.+) %{HTTP_HOST}$1
RewriteRule ([^.]+)\.test\.com(.*) /test-domain/$1$2
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>
<VirtualHost ###.###.###.###>
#secondary vhost
# http://specific.javadom.com/blahblah => /home/javadom/blahblah
(FILE PATH)
ServerName specific.javadom.com
#Redirect / http://specific.test.com/
RewriteEngine On
# $0 always means full token
RewriteRule (.*) /home/javadom/$1
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>
<VirtualHost ###.###.###.###>
#third vhost
# http://baby.javadom.com/blahblah => /non-test-domain/baby.javadom.com/blahblah
(URI)
ServerName *.javadom.com
RewriteEngine On
RewriteCond %{HTTP_HOST} !([^.]+\.test\.com$|specific\.javadom\.com)
RewriteRule ^(.+) %{HTTP_HOST}$1
RewriteRule (.*) /non-test-domain/$1
RewriteLog logs/rewrite.log
RewriteLogLevel 9
</VirtualHost>
8.