Change server ip to URL (127.0.1.168 to example.com:)

Hi, everyone.

Is it possible to change the server address to custom name ?
Like i use this ip http://172.22.96.*** to access the server , but i want to use any other word (example.com:slight_smile: i dont want to buy a domain and add it.

Thank You

Hi @rs115199789 :

Edit your hosts file, pointing your desired hostname to the ip address.

127.0.1.168    example.com    
172.22.96.X    other.com    

(location of this file can vary depending your OS)

Obviously, this will only work on your computer :slight_smile:
Hope this helps.

1 Like

can you share the path for the host file ?

I’m using ubuntu wsl in windows

Thank You

Hi @rs115199789:

hosts file is located under

C:\Windows\System32\drivers\etc 

Use notepad with administrator privileges to edit.
Check this:

Hope this helps.

Hi, @avc
can you share where to add or edit in this one.

 Copyright (c) 1993-2009 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.5****   rhino.acme.com          # source server
   38.25.63.10     x.acme.com              # x client host

localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 lmlicenses.wip4.adobe.com
127.0.0.1 lm.licenses.adobe.com
127.0.0.1 na1r.services.adobe.com
127.0.0.1 hlrcv.stage.adobe.com
127.0.0.1 practivate.adobe.com
127.0.0.1 activate.adobe.com
Added by Docker Desktop
192.1*** host.docker.internal
192.***gateway.docker.internal
To allow the same kube context to work on the host and the container:
127.0.0.1 kubernetes.docker.internal

End of section

My url- http://172.22****230/app/home
Desired- Erp.testserver.in

Thank You

Just add a line

172.22.96.230 erp.testserver.in

Thanks Alot :slight_smile: