Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a working domain www.mydomain.es and I need that mydomain.com and www.mydomain.com redirects to it. This is my bind config:

$ttl 38400
mydomain.com.   IN  SOA r12345.ovh.net. admin.mydomain.es. (
            1338024563
            10800
            3600
            604800
            38400 )
mydomain.com.   IN  NS  r12345.ovh.net.
www.mydomain.com.   IN  NS  r12345.ovh.net.

and this is my apache config:

DocumentRoot "/home/user/www/mydomain/site"
ServerName mydomain.com
<Directory "/home/user/www/mydomain/site">
allow from all
Options +Indexes
</Directory>
ServerAlias www.mydomain.com
Redirect permanent / http://www.mydomain.es/

but it doesn't work... This redirects mydomain.com to www.mydomain.es but fails redirecting www.mydomain.com (not found). In fact, mydomain.com responds to ping, but www.mydomain.com not.

What's the problem?

share|improve this question
    
Is this a complete Apache config, or a piece of a VirtualHost? –  Aredridel May 26 '12 at 17:58
    
@Aredridel no, that's just the "interesting" part. Usually I use webmin, and this is the piece of the file I've added through webmin. –  Ivan May 26 '12 at 18:24

1 Answer 1

up vote 4 down vote accepted

You need DNS A or CNAME records in order for the names to resolve.

You current have NS entries pointing to r12345.ovh.net., but that's for delegation, not generally single records - does that server have configuration to return a A or CNAME response? Or did you mean to just CNAME those names to r12345.ovh.net. instead?

share|improve this answer
    
Thanks, I haven't seen the NS.. changed to A and it works perfectly :) –  Ivan May 26 '12 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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