My domain on someone else's hosting

Started by ACKET, Jul 12, 2022, 10:35 AM

Previous topic - Next topic

ACKETTopic starter

Hi all.
This idle question has been tormenting me for a long time, and I decided to ask it.
I'm not very knowledgeable in this direction, so be indulgent. Imagine: I registered a domain and assigned it the DNS servers of a certain shared hosting provider.

Well, I think, now I will launch the site, and it will appear on the Internet! And some dude tied domain to his account with the same provider and ... that's it, bye.
My domain is no longer my domain. Could there be such a situation? And what to do then?
Yes, I understand that this is unlikely, but still ...


Your domain will remain yours as long as the registrar you bought it from thinks it's yours (that is, as long as the domain is linked to your account with the registrar and not with the host).
Then you can host it wherever you want. As long as the registrar receives your payment in a timely manner (usually an annual fee), the domain will be yours unless the registrar dies.


On a virtual web hosting, such a situation can occur only when an additional IP address is ordered for your website. In that case, the problem can be solved as follows:
Go to the website directory.
Open the file .htaccess for editing. If there is no such file, create one. To a file .htaccess add the following lines:

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^site\.com$ [NC]
RewriteCond %{HTTP_HOST} !^(.*)\.site\.com$ [NC]
RewriteRule ^(.*)$ http://ya\.com/$1 [R=410,L]

where: — this is the name of your website. Please note: the slash in front of the domain zone is critical; — that is website that someone else's domain (any other domain other than yours) will link to. If desired, you can specify any other site on the Internet as a goal.

If you have a VPS or a dedicated server
The easiest way to solve the problem is by setting the default domain: How to set the default domain.

If you do not have an ISPmanager control panel and you have sufficient Linux skills, you can register in the Apache configuration file the very first VirtualHost for the required IP address on any stub page. For instance, so:

<VirtualHost >
        DocumentRoot /var/www/default

Here: — the IP address of your website;
:80 is the port on which Apache is running. It may be different if you have any frontend server installed;
/var/www/default — the path where the stub files will be located.
This VirtualHost should go very first, before other VirtualHosts.