|
Hostname is an attribute of a system stored locally on that system. "Computer name" is what Windows uses to refer to the hostname. A subdomain is a DNS concept. In DNS, domain names (domains for short) can be authoritative or non-authoritative - if they are non-authoritative, that means another server "handles" that domain. So in a domain such as - one thing that could happen is that the root domain refers a lookup to a server handling the invalid domain, which then further refers the lookup to a server handling the mysite domain, etc. Your system might keep track of the domain it thinks it's on as well as a locally managed hostname. You can change your computer's local hostname, but this won't automatically update any DNS server pointed to your machine unless you have software specifically doing that (such as Active Directory in a corporate Windows environment). Many DHCP clients are also capable of changing a computer's local hostname in response to a DHCP response from a DHCP server. Typically a system's internal hostname and external DNS name will match, but they don't have to, though 99% of time you want them to. You can set your computer's hostname to the same as its full external DNS, and it usually makes sense to do so. Let's say you run a network somewhere, and have a DNS domain for it, such as mynetwork.invalid. Let's also say you are running your own DNS server, so any DNS requests for anything ending in mynetwork.invalid come to your DNS server. Now, let's say you have a couple servers, such as FTP, a Web server, etc. You'll have to create a record on your DNS server for each machine, and www was more a less a standard for Web servers in a network. So then ftp.mynetwork.invalid would point to your FTP server, and would point to your Web server, etc. You might choose to have the plain old mynetwork.invalid pointing to the most common service you run, such as the Web server, to save people from typing a lot and make your URLs look better, but if someone enters simply mynetwork.invalid on an FTP client, there will be problems. However, most modern sites are only running one service, not a bunch of servers running a bunch of different servers. So then a shortcut is taken - mynetwork.invalid is the only one used, and you might create a second DNS entry pointing to the same IP just for compatibility or those who are used to typing it. (责任编辑:) |
