Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm not really sure if this is something that I should worry about... I'm currently renting a dedicated server which is hosting a website I've created. The domain of the website was registered with GoDaddy. After submitting a sitemap to Google several months ago, I've noticed that another domain name is resolving to my IP address. This means that every page on my website is actually accessible from another domain. As far as I can tell, the other domain name is meaningless to me, so I'm not sure if this is something I should worry about or not. Is this a residual DNS record from another site that is probably no longer in use? Is it important from the standpoint of either security or SEO? My website is a .com which will later serve e-commerce purposes. The other domain has a top-level domain of st. It's the first one of those that I've encountered.

share|improve this question

2 Answers 2

up vote 4 down vote accepted

If they're really pointing their DNS records to your IP address (and your webserver is configured so that this actually shows your site's content on their domain; see Lazy Badger's answer), then you can stop this sort of "DNS hotlinking" with a simple mod_rewrite rule:

RewriteCond %{HTTP_HOST} otherdomain\.st$ [NC]
RewriteRule ^ - [F]

This will return a 403 Forbidden response to any HTTP requests coming in through otherdomain.st or any subdomains of it. If you use this in an .htaccess file, remember to prepend the standard magic invocation:

RewriteEngine On
RewriteBase /

Of course, there are literally infinitely many ways to customize this; for example, you could use [G] instead of [F] to return a 410 Gone response instead, which should cause search engines to quickly delist all the pages on that domain, or you could even just redirect the URLs to your own domain:

RewriteCond %{HTTP_HOST} otherdomain\.st$ [NC]
RewriteRule ^(.*)$ http://yourdomain.com/$1 [L,R=301]

Tempting as it might be, replacing the target URL in the rule above with a link to your favorite shock site is probably not advisable.

share|improve this answer

This means that every page on my website is actually accessible from another domain.

Any owner of domain can add in managed domain IN A|IN CNAME record, which will point to any IP in the Net, but if you're using name-based virtual hosts, then your site will likely¹ only be accessible via the hostname specified in the ServerName and ServerAlias directives.

However, if you're using IP-based virtual hosts (or no virtual hosts and the "main server" is simply bound to the IP), then any request to that IP will reach your site, regardless of the hostname.

¹ - One caveat to the case with name-based vhosts is that, the first vhost bound to that IP/port is treated as its default vhost. So even using name-based vhosts, a request to an unknown hostname can still be routed to your site if your it's the first vhost in your configs.

You can potentially avoid this by binding the VirtualHost directive to a particular hostname/domain, but this could present problems of its own if domain isn't owned by you.

The other way to prevent this would be to simply set the first name-based vhost aside as the default vhost and render an error message to the client.

share|improve this answer
    
Not necessarily. If he's using name-based vhost, then that's true. The rogue domain name won't be routed to his site (though it could still be routed to the "main" server if the Listen directive is bound to the server IP rather than the domain name). However, if he's using IP-based vhost, then the rogue domain will be routed to his site. –  Lèse majesté Mar 30 '12 at 4:10
    
@Lèsemajesté - oops, mea culpa. Forgot about IP-based vhosts. Can you rewrite me in more correct form, I'm slightly lost due to SE –  Lazy Badger Mar 30 '12 at 4:38

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.