having trouble with some DNS configuration, I have managed to get part of the site working, however adding the prefix 'www', I'm finding a little tricky.

Essentially, what I want is

mysite.net -> IP address (This works fine) www.mysite.net -> IP address (This is not working)

I would really appreciate some pointers here, I believe my syntax is what is the source of the problem, but having looked at materials online, I haven't been able to find a solution.

Here is my code for my zone.

$ORIGIN mysite.net.
@       IN SOA  ns1 admin.mysite.net. (
                                    0       ; serial
                                    1D      ; refresh
                                    1H      ; retry
                                    1W      ; expire
                                    3H )    ; minimum
    1D IN NS        ns1
    1D IN A
www             CNAME   mysite.net.
www     1D IN A
ns1             1D IN A

www.mysite.net needs to have an A record for, and it also needs to be www, hence the reason for the CNAME, but it won't resolve. Any ideas to what I have done wrong here?

  • Have also tried www.mysite.net. 1D IN A with no success, I know that it's not possible to have a record with CNAME, but how can I point the www. -> – user3019191 Nov 13 '14 at 12:40

CNAME is used to create aliases to the same destination, however your domains (mysite.net and www.mysite.net) do not share the same destination. You must set up two A records:

$ORIGIN mysite.net.
@      IN SOA  ns1 admin.mysite.net. (
                                    0       ; serial
                                    1D      ; refresh
                                    1H      ; retry
                                    1W      ; expire
                                    3H      ; minimum

@      IN NS        ns1          ; mysite.net is handled by ns1.

@      IN A    ; mysite.net is at
ns1    IN A    ; ns1.mysite.net is at
www    IN A    ; www.mysite.net is at

Here, you have three machines available:

  •, which is hosting the DNS server. It can be reached through ns1.mysite.net.
  • which is hosting the first website through mysite.net.
  • which is hosting the second website through www.mysite.net.

This configuration should be made on, which seems to be your authoritative name server here. However, there is no need for a CNAME entry.

However, let's say that now, you want to add the forum subdomain, the content for which is hosted on, you may use:

forum  IN CNAME     www          ; forum is an alias to www (    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.