1

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.

5
  • Try hostname.
    – Azodious
    Mar 19, 2013 at 6:38
  • what os are you using?
    – Red Cricket
    Mar 19, 2013 at 6:38
  • Unix machine...
    – Alok Verma
    Mar 19, 2013 at 6:40
  • 1
    Modifying HOSTS file is the best bet .
    – Raptor
    Mar 19, 2013 at 6:41
  • 1
    edit your /etc/hosts file add a line like 192.168.1.133 yourserver
    – Red Cricket
    Mar 19, 2013 at 6:42

2 Answers 2

4

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.

2
  • for Windows based system, there is HOSTS file too ( at C:\Windows\system32\drivers\etc\HOSTS )
    – Raptor
    Mar 19, 2013 at 6:40
  • 1
    You've been faster :-)
    – zero0
    Mar 19, 2013 at 6:44
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .