CFNetwork, round-robin DNS and IP failover
CFNetwork, round-robin DNS and IP failover
- Subject: CFNetwork, round-robin DNS and IP failover
- From: "Van Tol, Ladd" <email@hidden>
- Date: Wed, 06 Apr 2011 22:19:15 -0600
- Acceptlanguage: en-US
- Thread-topic: CFNetwork, round-robin DNS and IP failover
Suppose I am implementing an iPhone app that accesses an HTTP web service. The service is available at multiple physical locations, and is already setup with round-robin DNS. As such, if I fail a network connection, I would like to be able to cycle to the next host in the list, on the off chance that one of the facilities is having network issues.
I am currently using CFNetwork and CFHTTP*. What would be the easiest way to implement this? Do the DNS lookup myself with CFHost, and synthesize the URLs to have the desired IP address instead of host name?
To provide an example of this config, if you run a dig on api.foo.com, you might get something like this:
;; ANSWER SECTION:
api.foo.com. 290 IN A 192.168.1.2
api.foo.com. 290 IN A 192.168.1.3
api.foo.com. 290 IN A 192.168.1.4
api.foo.com. 290 IN A 192.168.1.5
A subsequent request will provide a cycled or permuted answer:
;; ANSWER SECTION:
api.foo.com. 290 IN A 192.168.1.3
api.foo.com. 290 IN A 192.168.1.4
api.foo.com. 290 IN A 192.168.1.5
api.foo.com. 290 IN A 192.168.1.2
- Ladd
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden