This HOWTO configures a DNS server to allow URL's of the form http://www.example.com and http://example.com - both URL's will get to the same web server. Seems its the cool thing to do these days.

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

; zone fragment for 'zone name' example.com
....
; SOA NS MX and other stuff

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

You could do the above for any other host name

You could do the above for any other host name e.g. ftp as long as different ports are in use e.g. ftp://example.com would 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:

<VirtualHost 10.10.0.23> ServerAdmin webmaster@example.com DocumentRoot /path/to/web/root ServerName www.example.com ErrorLog logs/error_log CustomLog logs/access_log common </VirtualHost>

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

<VirtualHost 10.10.0.23> ServerAdmin webmaster@example.com DocumentRoot /path/to/web/root ServerName example.com ErrorLog logs/error_log CustomLog logs/access_log common </VirtualHost>