Некоторые вопросы относительно Имени хоста

Это больше походит на вопрос о коде мне. Вы уверенный, Вы не нашли ответов на stackoverflow.com для этого?

Для меня просто кажется, что некоторый объект XMLReader оставляют открытым... так некоторый сервис или программа, которая использует его, должен быть закрыт правильно.

1
задан 9 October 2011 в 00:45
2 ответа
  1. Yes, you can give any hostname in /etc/hosts - this name will be known only to hosts and you.
  2. Yes, you can configure this way and have sites with unrelated to hostname names - most shared hosting do the same thing
  3. It doesn't affect nobody except outgoing mail from your VPS to this "intercepted" hostname (it it'll happen) - instead of sending to external Net it will be routed locally
  4. Yes, you can. Edit /etc/hosts and service network restart do all magic
1
ответ дан 4 December 2019 в 01:23

Whatever you choose for the hostname of your VPS will not effect its ability to operate. You can also change this whenever you like without any side effects. The one exception would be if you start to use this hostname in configuration files. By default nothing is going to be setup to use the hostname so unless you start to put it into configuration files yourself you should be OK to change it.

It does not mater if the hostname is a real valid hostname or not. You could potentially setup a hostname called server.mysite.superadmin. Obviously superadmin is not a valid TLD but that does not mater you can put it into your /etc/hosts file and reference your machine by that name. Additionally you could setup a private DNS server for the domain mysite.superadmin and setup A records for your server and it would work just as well if you pointed your client machines at that DNS.

The only thing that would not work is if someone who knows nothing about the mysite.superadmin domain wanted to view your website and they went to their DNS servers and asked for the IP address of server.mysite.superadmin. The first thing their server would do is ask the root DNS servers for the authorative dns servers for .superadmin at which point the root servers would respond with an error since .superadmin is not a valid TLD.

You can also choose an existing domain name that is owned by someone else and setup your hosts file and your own DNS to thing its authoritative for that domain and use it. If you put www.microsoft.com in your hosts file and pointed at your IP address you could reference yourself using www.microsoft.com. Your hosts file is referenced before any DNS servers are checked. Additionally you could setup your own DNS server and tell it that it is authoritative for www.microsoft.com and if you point your client computers at that DNS server it will work. Just like in the previous example though the root DNS servers will not ever return your DNS server as the authoritative DNS server for microsoft.com in a recursive lookup by third parties. It would only work if you explicitly told your machine to use your DNS server.

For your site to host real websites all you need to do is setup the A records for those websites to point at your VPS's public IP address. You must do this in the authoritative DNS server for the domain. If you own the domain you can setup your own DNS server on your VPS and make that the authoritative DNS server by updating the record with the registrar. You could also use the registrar's DNS or other third party DNS providers. I normally like using third party DNS providers who provide multiple DNS servers in different geographical locations and data centers. DNS services are really dirt cheap and can be difficult to provide on your own. Not that setting up BIND is difficult but having the redundancy that a third party service can provide you is.

0
ответ дан 4 December 2019 в 01:23

Теги

Похожие вопросы