how domain.com to www.domain.com

Harold Pritchett harold at uga.edu
Sat May 26 13:31:21 UTC 2001


Jan wrote:
> 
> > how to configure that when people type "domain.com" , the bind
> > translate it to "www.domain.com"??
> 
> hi,
> 
> same question was answered (for me...) a few days ago. You might want to
> search the archive...
> 
> Anyways, in your master zone definition file, put this line:
> domain.com.     IN      A       xxx.xxx.xxx.xxx
> 
> Where xxx.xxx.xxx.xxx is the ip of your www server. Be sure the www server
> (Apache?) has a virtual host for domain.com
> 
> This works fine for me with Bind 9.1.2 and Apache 1.3.19.
> 
> I was also wondering - anybody knows - can the above line point to a CNAME
> instead of pointing to an ip?

No.  There are other records associated with the domain name, an SOA record,
some number of NS records, maybe a MX record and perhaps others.  You can't 
use a CNAME here.

What I do, however is use the CNAME on the www.domain.com record and have
it point to the domain.com record.
something like

$TTL 86400
@       in      soa     dns1.domain.com. harold.dns1.domain.com. ( 
                                        2001050903      ; Serial 
                                        28800           ; Refresh 8 hours 
                                        7200            ; Retry 2 hours 
                                        604800          ; Expire 7 days 
                                        86400 )         ; Minimum TTL 1 day

                in      ns              dns1.domain.com.
                in      ns              dns2.domain.com.
                in      ns              dns3.domain.com.
                in      mx      10      mail1.domain.com.
                in      mx      10      mail2.domain.com.
                in	a		192.168.1.11
;
;
                in      rp              postmaster at domain.com. pmtxt  
pmtxt           in      txt             "john Doe (706) 555-1212"
;
localhost       in      a               127.0.0.1
;
dns1            in      a               192.168.1.9
dns2            in      a               192.168.1.193
dns3            in      a               192.168.242.249

www             in      cname           domain.com.

mail		in      mx      10      mail1.domain.com.
                in      mx      10      mail2.domain.com.

mail1		in	a		192.168.3.5
mail2		in	a		192.168.4.5

-- 
Harold Pritchett
The University of Georgia
harold at uga.edu


More information about the bind-users mailing list