unknown
unknown

Reputation: 866

fixing the www record in my dns zone?

I have domain name ie. example.com, I have a problem where if i go to http://example.com it works, however if i go to www.example.com, it doesn't work, my dns zone file is as follows

 NAME    TYPE    Value 
 @       A       ip_address     // http://example.com this works!
 www     CNAME   example.com    // this deosnt work.

I don't know what the problem is, I searched online but couldn't find anything, my domain name is registered with gandi.net, if thats any help.

Upvotes: 0

Views: 214

Answers (2)

aadlani
aadlani

Reputation: 661

The CNAME resource record takes as value a domain name. This value is either relative to the current domain or absolute. The absolute domain name takes a dot at the end. Here's the reference from the RFC1033:

Domain names in the zone files can be one of two types, either absolute or relative. An absolute name is the fully qualified domain name and is terminated with a period. A relative name does not terminate with a period, and the current default domain is appended to it.

If you take your example.com zone, you could have

@        A       XXX.XXX.XXX.XXX
www      CNAME   @

or (notice the dot at the end of example.com.)

@        A       XXX.XXX.XXX.XXX
www     CNAME    example.com.

Upvotes: 1

Geoffrey Hing
Geoffrey Hing

Reputation: 1765

I would try using @ and example.com consistently, so either:

NAME   TYPE    Value 
@       A       ip_address     // http://example.com this works!
www     CNAME   @  // this deosnt work.

or

NAME             TYPE    Value 
example.com      A       ip_address     // http://example.com this works!
www              CNAME   example.com    // this deosnt work.

Upvotes: 0

Related Questions