Register Login

Add Entry of Host in hosts file for host name and saptranshost

Updated Dec 05, 2020

For the SAP installation, you need to configure SAP Server host name and SAPTRANSHOST name. In this post, we will learn the detailed steps to do it.

To explain the process of to adding HOST name and SAPTRANSHOST name for the server, we will use the following configuration details –

  • SAP Server Host name: server
  • SAP Transport Host name: saptranshost
  • IP address: 192.168.1.22 (168.1.XXX) is IP address reserved for local host

But first, let us know the basics.

What is Hosts file in Windows?

In Windows, the hosts file is a normal plain text file containing IP addresses and host names. This file is used for mapping servers or hostnames to their appropriate IP addresses. Sometimes, this file can be modified to solve connectivity issues. 

What is SAPTRANSHOST Name?

SAPTRANSHOST is the name given to the transport host which you have entered on your domain name server.  

How to add HOST name and SAPTRANSHOST name for SAP Server?

Please follow the steps below in order to add entry of Host in hosts file for host name and SAPTRANSHOST

Step 1. Go to this path

C:\Windows\System32\drivers\etc

2. Open 'hosts' file in notepad in Administrator mode

hosts file

Step 3. Go to end of the file and add given below line

<IP Address of Server> space <Host Name>

192.168.1.5 server
192.168.1.5 saptranshost

The final file will look something like this –

hosts

Step 4. Save the file

Points to keep in mind while editing host file –

  • Single entry in a single line
  • At first IP address will be mentioned, then after a space, put the host name
  • There must be a single space between IP address and the host name

Edit the Hosts File in Windows 10

Location:

C:\Windows\System32\drivers\etc

Location of hosts file in Windows 10

In Windows 10, you can open the hosts file in a 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 it as a new file, or it will give show following error:

"You don’t have permission to save in this location. Contact the administrator to obtain permission"

To save this file you need to open it in Administrator mode.

Open hosts file as Administrator in Window 10

  1. Click on the Start menu or press the Window key and type Notepad
  2. Right click and select "Run as administrator"

  1. In Notepad, click Open. In the file name field, paste the given URL and press Open,
C:\Windows\System32\drivers\etc\hosts
  1. 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

Go to this location: /etc/hosts

1. Open hosts file using vi editor

# vi /etc/hosts

Edit hosts file in Mac

1. Open your Terminal application

2. Enter the following command:

sudo sh -c 'echo <IP address> host name >> /etc/hosts'

Example

Host name: server
IP address: 192.168.1.5

sudo sh -c 'echo 192.168.1.5 server >> /etc/hosts'

Conclusion

Following the instructions one by one will set up your SAP Host name and SAPTRANSHOST name. Feel free to comment below if you are facing any difficulties.  


×