1

Hosts file changes not showing their effect. I need to add a domain name alias to my localhost address so that when I type "myfictiousdomainname.com" it should request localhost:8084 address on my computer. But I made all attempts to make the hosts file work but it doesn't.

Now I need the kind of thing like I use Fiddler2 in Windows7/8 to set this domain name alias. Is there anything alike for ubuntu 12.04 or how could i otherwise setup this domain alias for a localhost address?

1 Answer 1

1

You can alias your host domain, which is fairly simple. You define it in /etc/hosts

127.0.0.1  wintermute.example.com

However, you will not be able to route the host to that specified port without adding it to whatever the resource calling the custom domain is. Thats not how DNS works, DNS is simply ip resolution/aliasing. Depending on how you want to look at it.

With the above example, it can be accessed via wintermute.example.com:8084

5
  • oh ok.. now I see that your solution works but in windows I saw that if I had in hosts file 127.0.0.1:8084 example.com then I could access using example.com (without port no.). It did worked in windows but as you say it doesn't work in ubuntu !? Feb 5, 2014 at 18:40
  • Is there anything else I could avail to make me use wintermute.example.com instead of wintermute.example.com:8084? Feb 5, 2014 at 18:42
  • You could add a port forward in IPTables, setup a reverse proxy in NGINX/Apache - are 2 examples available to you
    – lazyPower
    Feb 5, 2014 at 18:59
  • would be awesome if you could add to your answer about how to do it using IPTables .. Feb 5, 2014 at 19:04
  • askubuntu.com/questions/92483/local-port-forwarding This has been answered before, and they give a pretty comprehensive answer
    – lazyPower
    Feb 6, 2014 at 13:30

You must log in to answer this question.

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