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

I have a server setup where two sites are virtually hosted. They share the same IP address, of course, and the server runs Plesk to manage the sites.

DNS is setup so that @ A points to the ip address 119.82.29.130. www CNAME is setup to point to nagoyatax.com. That's website one. When you visit nagoyatax.com or www.nagoyatax.com the website for this domain shows up correctly.

website 2:

DNS is setup so that @ A points to the ip address 119.82.29.130. www CNAME is setup to point to tourismbuilder.com. Now here is the weirdness. tourismbuilder.com correctly points to the tourismbuilder.com website. However, www.tourismbuilder.com points shows the natoyatax.com website.

Why is this happening and how can I fix it? Not a DNS guru so let me know if you need more information. Thanks!

share|improve this question

3 Answers 3

up vote 3 down vote accepted

I would suspect that you don't have a ServerAlias setup for www.tourismbuilder.com within the tourismbuilder.com vhost definition.

<VirtualHost *:80>

    ...
    ServerName tourismbuilder.com
    ServerAlias www.tourismbuilder.com

    ...

and the reason you see the nagoyatax.com is that it is the first vhost defined and is then the default vhost.


From the comments. Plesk has a www checkbox that will create a suitable ServerAlias if checked.

share|improve this answer
    
This was the issue. There is a 'WWW' checkbox available when creating a new site. I forgot to check that box and this the ServerAlias directive was not added. Just a heads up to anyone using Plesk and get the same issues. Thanks again! –  user658182 Aug 20 '12 at 11:04

Your DNS seems to be correctly set up:

;; QUESTION SECTION:
;www.tourismbuilder.com.        IN  ANY

;; ANSWER SECTION:
www.tourismbuilder.com. 14400   IN  CNAME   tourismbuilder.com.

;; ADDITIONAL SECTION:
tourismbuilder.com. 14400   IN  A   119.82.29.130

If you run Apache as your web server, I would say that the issue lies within the configuration of the web server.

The reason that the first site works on both names is most likely that it is the first vhost, which causes Apache to default to it if it doesn't have a match.

Try opening the vhost configuration for tourismbuiler.com and add this line

ServerAlias www.tourismbuilder.com

Right underneath the "ServerName" line.

share|improve this answer

If you cannot edit the DNS zones manually (and change the www CNAME record for tourismbuilder.com) then you need to submit a ticket to your hosting provider.

I would suspect that a script was used to generate the zone files on creation of the site or account; perhaps it was entered incorrectly or there's a parsing bug of some sort.

share|improve this answer
    
I have ssh access to the server. Is it possible to check that way? What file would I look at? Cent OS is the OS –  user658182 Aug 20 '12 at 10:29
    
It's very unlikely you would be able to edit the zone files from your SSH access. You're more than likely jailed in your home directory. –  gravyface Aug 20 '12 at 11:15

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.