What is Hosts File
Hosts file is simple text file use for mapping of IP address and host name.
To do the server installation of SAP system we have taken our server name as "server" and SAP Transport Host as "saptranshost" ?
Out Server IP: 192.168.1.22 (192.168.1.XXX) is IP address reserved for local host.
- SAP Server Host Name: server
- SAP Transport Host Name: saptranshost
Please follow the steps below in order to add entry of Host in hosts file for host name and saptranshost:
Hosts file path
1. Go to the path >>
2. Open 'hosts' file in notepad in Administrator mode
3. Go to end of the file and add given below line
<IP Address of Server> space <Host Name>
The output file will look similar like as below image:
4. Save the file...
Points to keep in mind while editing host file
- Single entry single line
- First IP address then Space then host name
- There must be a single space between IP address and host name.
Edit the Hosts File in Windows 10
In Windows 10 you can open the hosts file in notepad but when you try to save the hosts file, it won't allow you to overwrite the file it will ask you to save as new file, or it will give the following error:
"You don’t have permission to save in this location. Contact the administrator to obtain permission"
To save file you need to open hosts file as administrator
Open hosts file as administrator in Window 10
1. Click on start menu or press the Window key and type Notepad.
2. Right click and select "Run as administrator".
3. In Notepad click open and in the file name field paste the given URL and press Open, this will open hosts file in Notepad as Administrator, now you can edit and save the changes in hosts file.
Edit hosts file in Linux
1. Open hosts file in vi editor
# vi /etc/hosts
Edit hosts file in Mac
1. Open your Terminal application
2. Enter command:
sudo sh -c 'echo <IP address> host name >> /etc/hosts'
Host name: server
IP address: 192.168.1.5
sudo sh -c 'echo 192.168.1.5 server >> /etc/hosts'