Bu sorunun altına yapıştırılan /etc/hostsbir Linux (CentOS) ve Windows makinesinden bir dosya örneğidir . Linux dosyasının IP adresinden sonra iki sekmeli girişi vardır (bu, localhost.localdomain localhost) ve Windows yalnızca bir tane içerir. Eğer windows'da hosts dosyasını Windows'da localhost yerine makine ismine (etest) sahip olarak düzenlemek istersem, localhost kelimesini sadece istediğim makine ismi ile değiştiriyorum. Makinenin bir etki alanının parçası olması gerekmez.
Bir Linux makinesinde, iki giriş localhost.localdomainve localhostmakinenin bir etki alanının parçası olması için ihtiyacım olacağını belirtiyor gibi görünüyor. Bu doğru mu?
Her iki girişi etestde okuyacak şekilde düzenleyebilir miyim :
127.0.0.1 etest etest
veya bir girdiyi etki alanı adıyla değiştirmem gerekir mi?
Ek olarak, lütfen /etc/hostsLinux makinedeki dosyanın ikinci satırının ne olduğunu bana bildirin .
::1 localhost6.localdomain6 localhost6
hosts Linux makinesinde dosya:
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
hosts windows makinesinde dosya:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost