Answer the question
In order to leave comments, you need to log in
So how is it right to attach domains and subdomains to hosting, what is the most correct way?
Hello, please give the newbie the right education and the rules of good taste in matters of linking a domain / and its subdomains with hosting.
As I understand it, there are two ways, by
writing NS records (as here https://www.reg.ru/support/hosting-i-servery/sajty... )
Or simply by adding A-records with the IP address of the server in the domain, like in the instructions here support.2domains.ru/knowledgebase.php?article=66 . Somehow, from the very beginning, I use this particular method, as advised in the article,
i.e. I add three A-records to the domain with the address of the hosting server, like:
@
www
*
And everything seems to be working, and no dns servers need to be registered.
I just recently noticed that with such a config on Apache hosting, incredible things happen, for example, any subdomain of the site.ru site (absolutely any, you can guess, for example, sub1.site.ru) will display the contents of the site.ru site, although I configs did not touch and did not change. And for example, a domain that is simply linked to the server through the A records described above, but does not have a host record and directory created for it, will display the contents of another neighboring site on the hosting at its address. Tin in general.
Please tell me, as it is right, according to the Orthodox, everything should be done? And how then to send subdomains of the main domain to hosting, so that everything is displayed correctly and correctly and only where necessary?
Answer the question
In order to leave comments, you need to log in
Both options are correct.
Concerning misunderstandings in the second variant. Well, you yourself indicated that * - i.e. all subdomains link to your site. And then everything happens as you set it up:
for Apache:
<VirtualHost a.b.c.d:80>
ServerName site.ru
ServerAlias www.site.ru *.site.ru
...
</VirtualHost>
what are NS records? understand the terms.
That's right - A record so that at the address mydomain.com you get to the desired server (the correct IP was determined)
The NS server in the record points to the NS servers that will respond to those who will look for mydomain.com
And the fact that you have apache on hosting is configured crookedly, that's another question. Apache supports virtual hosting, and different sites can hang on the same IP. How Apache is configured, so it will respond to sites unknown to it (give default for example)
DNS always works one way. Each zone (domain) is served by at least two DNS servers. Primary (primary) stores the original file that describes the zone, the IP addresses of its machines, subdomains and other information. The secondary (secondary) server, or servers, stores the same information received from the primary. It's insurance against his failure. Ideally, all servers should have different network connections. They are all listed in the zone file as entries of type 'NS'.
DNS servers can be at the owner of the resource, they can be provided by a web host or registrar, when delegating a domain. The main thing is that they should be at least two, and with synchronous information.
You can edit the zone file and its entries both directly and through the web interface. This does not change anything.
If you create a web server, then the record about it must be in the zone of its domain, i.e. in the end, we should set its IP address. This is an 'A' record or a link to another 'A' record.
Now about the web server. Its protocol allows obtaining information about the domain name of the site being accessed.
Therefore, several different sites can be given the same IP address. This is a permitted move. The Web server will still understand which one is being accessed.
This trick is called 'name based virtual hosting' or 'virtual hosting based on domain names'.
To implement this, you need to properly configure your web server. The mentioned Apache is perfectly able to do it.
You need to study the documentation for a specific one, paying attention to setting up virtual hosting.
2Checkout.com? I myself do not use it for reception, but I often meet it for payment on different sites. You can use both card and paypal. With the conclusion there, too, everything seems to be fine.
Perhaps the author will no longer be relevant, but someone else may need it: www.payanyway.ru (commission for cards from 3% or less, it is possible to enable acceptance of cards from non-Russian banks as agreed)
Good time of the day! I myself have almost completely switched to online payments. The most suitable site for me was www.businesskassa.com I recommend it.
This will make it easier for you to compare several companies with each other and choose the right one. On this site - https://mainmine.ru/priyom-platezhej-na-saite - you can do just that. There you can compare the percentage of the commission by indicating the turnover, rubles / month and the type of your activity, then you will have a convenient list of companies that provide such services.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question