Search code examples
javaapacheproxyapplication-server

Apache proxy - update ip address?


how can I (dynamically) update a ip address for server whose ip changes and cannot be refered to by dns/dyndns?

For example:

  ProxyPass /myapp/ myapp.domain.com

/etc/hosts:

254.153.12.2. myapp.domain.com

Always if /myapp/ is called from outside, remapping should take place to myapp.domain.com. But this is not a domain exposed to the outside. It is only used internally on the server through the hosts file. Inside the hosts, the real ip can be found.

Now I'm looking for a way to either: a) update the ip in hosts through a web interface b) any other approach that would work beside the hosts file

Any ideas of you pros?


Solution

  • The resolver is part of the operating system - and you didn't say what OS this was running on.

    The hosts file has no way of indicating expiry time, so you're probably going to have to implement a local DNS server just for this - but I see you mention Java - I've had lots of problems in the past with Java not handling DNS records the way it is supposed to - so even this might not work as it should.