First of all, I will talk a little about the purpose of this question. We have several linux boxes on the same network on which different services are installed, some times these boxes are decommissioned and new boxes take its place. The services also need to be moved along with thoxe boxes. Now my internal web portal which is built in angular.js has to be be redeployed with the new set of hardcoded urls to access the services in the new boxes.

I am trying to get around this problem by creating a page that we could use to change the backend database and trigger the website to reload the url mappings from the DB. So in the event there is a box move the service urls can be picked up dynamically on changing the config. All the configuration is stored in a Database.

I havent figured out the triggering part yet. Is this the correct way of creating the setup, or am I doing it all wrong. With my limited knowledge in web dev this is all I could come up with.

Any pointers or reference docs would be very useful.

Thank You!

2 Answers 2


Short answer:

Do the name to box resolution at the network tier, either setup a DNS server as the 'database' that holds the resolution table, or do it in the router. An easier approach might be to set up the routes in your web portal machine's hosts file. Depending on how you make the calls that might not need a redeploy.

Longer answer:

I you want to go for a bigger change then an approach used in the new 'cloud' way would be to have a state store keeping track of your network topology. So if each application was in a docker container and your network mapping (key = hostname to value = ip address ) was in say ZooKeeper then the 'triggers' can be ZooKeeper watchers that are capable of spinning up new docker conatiners when a new child node is created in your ZooKeeper registry.


  • There are other ways of storing the state than ZooKeeper.
  • If you don't want to use docker containers then you could use Virtual Machines.
  • thanks for the information. Finally resorted to Zookeeper, I am doing both service discovery and config management with Zookeeper.
    – deb
    May 14, 2015 at 14:18

Use CNAMEs in your internal DNS. Then you just point your url at e.g. http://foo-service.example.com/ and leave it there.

When you move the service from machine A to machine B, move the CNAME.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.