HOWTO support

This HOWTO configures a DNS server to allow URL's of the form and - both URL's will get to the same web server. Seems it's the cool thing to do these days. Though just to really tick you off - if you type into a decent browser (read Gecko based) it will automatically try for you! So you don't actually need to do anything - 'cept use a good browser.

Beware: You will also have to change your web server for this to work (change defined below for Apache using Virtual hosts).

; zone file fragment for
; SOA NS MX and other stuff

; define an IP that will resolve
                 IN      A
; you could also write the above line as 
;  IN      A
www             IN      CNAME ; dot essential
; aliases to
; OR define another A record for www using same host
; this is the least number of changes and saves a CNAME
www              IN      A

The above will also work for any other service, such as ftp, as long as different ports are in use, for example, will work if your FTP server was appropriately configured and on the same host.

Apache change

Assuming you are using virtual hosts on an Apache server you will have a definition in your httpd.conf file something like this:

    DocumentRoot /path/to/web/root
    ErrorLog logs/error_log
    CustomLog logs/access_log common

you need add a second definition with ServerName modified to reflect your change as follows:

    DocumentRoot /path/to/web/root
    # if logging per host needs separate files
		ErrorLog logs/another_error.log
    CustomLog logs/another_access.log common

An alternate method is to use a single <VirtualHost> definition using the ServerAlias directive as shown below:

    DocumentRoot /path/to/web/root
    # if logging per host - use a single file
		ErrorLog logs/error.log
    CustomLog logs/access.log common


  1. In many cases when you type in your browser, the ever helpful browser will auto-complete (or guess) that what you really meant was and add the www. So after all that hard work in many browsers would have worked even if you had done nothing!

  2. If you are using MS Frontpage extensions with a single <VirtualHost> definition then the ServerName must be the name that is used to login to FP. In the example above the FrontPage login name used would be When using FP if the ServerName were and the ServerAlias were then the FP login would fail.

Pro DNS and BIND by Ron Aitchison


tech info
guides home
dns articles
1 objectives
big picture
2 concepts
3 reverse map
4 dns types
5 install bind
6 samples
7 named.conf
8 dns records
9 howtos
10 tools
11 trouble
12 bind api's
13 dns security
bits & bytes
15 messages
notes & tips
registration FAQ
dns resources
dns rfc's
change log