Linux/etc/hosts

Source: Internet
Author: User

Use:

Associating host names and IP addresses

At the start of the machine, before the DNS works, you need to know some of the host name and IP address mapping, the mapping relationship is stored in the/etc/hosts file, the DNS does not work properly, all network programs in the system will view the file to determine the IP address corresponding to the host name.

Format:

One IP address per line

IP_Address Canonical_hostname [aliases ...]

Comments:

From #开始, to the end of a line.

Example one:

127.0.0.1 localhost.localdomain localhost
:: 1localhost6.localdomain6localhost6

Example two:

# The following lines is desirable for IPV4 capable hosts       127.0.0.1       localhost       # 127.0.1.1 was often used for t He FQDN of the machine       127.0.1.1       thishost.mydomain.org  thishost       192.168.1.10    foo.mydomain.org       foo       192.168.1.13    bar.mydomain.org       bar       146.82.138.7    master.debian.org      Master       209.237.226.90  www.opensource.org       # The following lines is desirable for IPV6 capable hosts       :: 1< C19/>localhost ip6-localhost ip6-loopback       ff02::1         ip6-allnodes       ff02::2         ip6-allrouters

Linux/etc/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.