Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

We have several web applications running on several load-balanced servers. We want to have our web applications communicate with each other without first traversing outside the load balancer.

For example:

  • http://appA.example.com is running on 192.0.2.1 and 192.0.2.2
  • http://appB.example.com is also running on 192.0.2.1 and 192.0.2.2
  • The load balancer's public IP address is 198.51.100.3
  • By default, when appA on 192.0.2.1 makes a call to a WCF service hosted in appB, the HTTP request is routed to 192.51.100.3; this establishes a new session and the load balancer will direct the call to either of the two servers
  • We want the call to be routed to the instance of appB running on the same server so we add 192.0.2.1 appB.example.com to the hosts file on 192.0.2.1.

This eventually works, but we either have to wait for the app pool to naturally recycle or do a manual reset before appA sees the new address.

Is there any way to have the change automatically detected without having to recycle the app pool?

share|improve this question

1 Answer 1

At Safeco, we used a DNS server for this purpose.. we made CNAME aliases.. all stored in one place.. when we made a change like this, it started working immediately. DNS server is basically like a hosts file, but a lot more capable.

share|improve this answer
    
a bit overkill for general use, but still a good answer –  PatomaS Oct 22 '12 at 6:30
    
This doesn't quite work for me. I have two servers hosting the same two apps. The reason for using the hosts file is because I want the primary app on each server to use the secondary app on the same server. In order to use DNS, I'd have to have one entry for each server and reconfigure the two primary apps to use the right name. That's problematic for other configuration management reasons. –  Brenda Bell Oct 28 '12 at 13:29
    
no.. changing to FQDN for everything makes it easier.. because then you can change it in one place (for all connection strings) instead of changing connection strings in 10 different places. It's genius. SqlApp1.corpname.com can point to one machine and SqlApp2.corpname.com can point to secondary machine. If you want to swap them, you can swap them, no problem. DNS is easier, you change things in one place, instead of HOSTS file on two servers. –  Aaron Kempf Oct 28 '12 at 18:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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