How to alias ip address of a system, I am running a application on my local server but typing ip address in URL doesn't looks good.
2 Answers
If it is Linux, Unix, Mac (*nix based system) then you add an entry like this in /etc/hosts
file:
127.0.0.1 www.example.com
If it is Windows based OS then you add can an entry in %WinDir%\HOSTS
OR %systemroot%\system32\drivers\etc\hosts
file.
-
for Windows based system, there is HOSTS file too ( at C:\Windows\system32\drivers\etc\HOSTS )– RaptorMar 19, 2013 at 6:40
-
1You've been faster :-)– zero0Mar 19, 2013 at 6:44
You might want to add a line to your /etc/hosts
(or your c:\windows\system32\drivers\etc\hosts
) like this:
127.0.0.1 myfancyhostname
So http://myfancyhostname/
will point to 127.0.0.1
- like DNS for the poor man. Maybe this helps you to have better looking URLs (I suppose it's for a demo) without changing your hostname or establishing an DNS server.
hostname
./etc/hosts
file add a line like192.168.1.133 yourserver