Skip to end of metadata
Go to start of metadata

The "Hosts file" format can severely impact the Diagnostics Agent, the SAP Host Agent, connectivity between Managed Systems and Solution Manager.

More information on the note : 2926115 and note : 611361


Where is located the /etc/hosts file ?

The location of the "Hosts file's" is the following:

  • On Unix/Linux: /etc/hosts
  • On Windows: C:\Windows\System32\drivers\etc\hosts



Do we have a maximum total amount of entries for the /etc/hosts file ?

No,

But more lines are existing in the /etc/hosts file more your system and the network configuration will be difficult to maintain

Because the "Hosts file" format can severely impact the Diagnostics Agent, the SAP Host Agent and the connectivity between Managed Systems and Solution Manager

An /etc/hosts file with a maximum of 10 lines is strongly advice 

We also strongly recommend you to use a DNS whereas using the /etc/hosts file itself for huge network


For more information following the information in MCSA/MCSE 70-254: Monitoring and Troubleshooting Network Activity :

  • Hosts files are very effective in small environments with a limited number of hosts; however, the vast number of Internet resources led to the development of DNS.



What is the information order for the /etc/hosts file standard format ?

The Mandatory Information order on the /etc/hosts file are the following :

1st position: IP address 

2nd position: FQDN (Full Qualified Domain Name)

3rd position: Short hostname


# Correct format with correct line information order :

#IP                                      Full Qualified Domain Name                              Hostname

ALL the line on the /etc/hosts file have to be maintain following this order

If one line is formatted incorrectly the /etc/hosts file will be unreadable


===============================================================================================

=================================        Incorrect /etc/hosts file Format         ==================================

===============================================================================================

# Incorrect format with incorrect line order in the hosts file :

#IP                                              Hostname                                      Full Qualified Domain Name                                    

(This example is strictly forbidden you cannot have the IP Hostname and FQDN in this order)

(The correct order is IP FQDN Hostname)


===============================================================================================

========================================       See Also      ============================================

===============================================================================================

For more information please verify the Standard format definition :

The "hosts" file standard format is defined as per RFC952 (Hosts Table Convention).

  • The RFC for protocols specify these labels must only contain the ASCII letters a through z (in a case-insensitive manner), the digits 0 through 9, and the hyphen-minus character ('-'). The original specification of hostnames in RFC 952 disallowed labels starting with a digit or with a hyphen character and end with a hyphen. However, a subsequent specification (RFC 1123) permits hostname labels to start with digits. No other symbols, punctuation characters, or whitespace are permitted. Internationalized domain names are stored in the Domain Name System as ASCII strings using Punycode transcription.[4]


What correct format can we use with Physical, Virtual and Logical host on the /etc/hosts file hosts ?

The requirement regarding /etc/hosts file regarding Physical/Virtual and Logical is the following

Each hosts Physical Virtual or Logical have to be define unique in the /etc/hosts file 

For more information see : SAP Note 962955

# Correct format regarding order Physical, Virtual and Logical Host :

#IP                                 Full Qualified Domain Name                      Hostname

Each host are define with unique IP FQDN and Hostname


===============================================================================================

=================================        Incorrect /etc/hosts file Format         ==================================

===============================================================================================

# Incorrect format regarding order with Physical, Virtual, Logical Host :

#IP                               Full Qualified Domain Name                       Hostname                                                            

                           

(This example is strictly forbidden you cannot have Physical, Virtual, Logical host with the same IP address)


# Incorrect format regarding order with Physical, Virtual, Logical Host :

#IP                                   Full Qualified Domain Name                         Hostname                                                            

               

(This example is strictly forbidden you cannot have Physical Virtual Logical host with same IP and define on the same /etc/hosts file line)



Does "IP addresses", "FQDNs" and "Hostnames" are unique on the /etc/hosts file ?

Yes, all mentioned "IP addresses", "FQDNs" and "Hostnames" have to be unique in the host file to make it readable for SAP Server, it is not possible to have two times the same entry in the /etc/hosts file

# Correct format regarding duplicate :

# Unique IP                                   Unique Full Qualified Domain Name                         Unique Hostname

You can see on this example there is not any duplicate entries in the /etc/hosts file


===============================================================================================

=================================        Incorrect /etc/hosts file Format         ==================================o

===============================================================================================

# Incorrect format with duplicate IP address :

#IP                                        Full Qualified Domain Name              Hostname

(This example is strictly forbidden you cannot have duplicate IP address)


# Incorrect format with duplicate FQDN :

#IP                                          Full Qualified Domain Name               Hostname

(This example is strictly forbidden you cannot have duplicate FQDN)


# Incorrect Format with duplicate Hostname :

#IP                                        Full Qualified Domain Name               Hostname

(This example is strictly forbidden you cannot have duplicate Hostname)


===============================================================================================

========================================       See Also      ============================================

===============================================================================================

For more information please verify the "hosts" file standard format defined as per RFC952 (Hosts Table Convention).

  • The RFC for protocols specify these labels must only contain the ASCII letters a through z (in a case-insensitive manner), the digits 0 through 9, and the hyphen-minus character ('-'). The original specification of hostnames in RFC 952 disallowed labels starting with a digit or with a hyphen character and end with a hyphen. However, a subsequent specification (RFC 1123) permits hostname labels to start with digits. No other symbols, punctuation characters, or whitespace are permitted. Internationalized domain names are stored in the Domain Name System as ASCII strings using Punycode transcription.[4]



Does two different FQDN for the same IP address is authorized ?

No, two different FQDNs for the same IP address is forbidden, will create error on the IP and hostname resolution,

The /etc/hosts file will not be able to contain' s 2 different FQDNs for the same IP address following the standard format RFC


# Correct format regarding FQDN :

#IP                                  Full Qualified Domain Name                       Hostname


===============================================================================================

=================================        Incorrect /etc/hosts file Format         =================================

===============================================================================================

# Incorrect format regarding FQDN :

#IP                           1 Full Qualified Domain Name                              2 Full Qualified Domain Name                                 Hostname

             

(This example is strictly forbidden you cannot have 2 FQDN for the same IP address, each IP must have only one FQDN referenced)

In case you would like to use 2 FQDN for one IP it is not standard cause one IP must have been associate only with one FQDN please verify the network possibility for this request



How do we apply modification of the /etc/hosts file ?

Any modification of the "hosts" file will require an OS restart, or at least a restart of the Network Service and the Diagnostic Agent.

You can :

  • Restart the host completely do a Reboot

or at least

  • Restart the Network Service following this command :
    • On Unix/Linux: restart /etc/init.d/networking
    • On Windows: restart the network service

Please remember that if one of these action have not been done at least

The modification will never been applied

  • No labels