Linux under hostname and hosts

Source: Internet
Author: User

Reference: http://wp.fungo.me/linux/what-the-hell-is-hostname.html

Hostname is the machine name, a variable in the kernel, can be temporarily modified or permanently modified

/etc/hosts The local DNS system, query the domain name will be first in this file inside the query, can not find the system DNS to find

So hostname and the hosts didn't have a half-penny relationship.

However, it is easy to cause confusion in the following situations:

Assuming that the domain name clickme.com is a DNS can not find the domain name, a machine hostname is precisely clickme.com, and on a machine want to access the native HTTP service through http://clickme.com, found inaccessible, and in/etc/ Add a row to the hosts

127.0.0.1 clickme.com

, found that can be accessed through the hostname, and thus mistakenly think that/etc/hosts and hostname have some kind of association (similar to let hostname into effect, etc.), is actually just a coincidence.

Linux under hostname and hosts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.