• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CFNetwork, round-robin DNS and IP failover
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: CFNetwork, round-robin DNS and IP failover
      • From: Josh Graessley <email@hidden>
  • Prev by Date: Is it possible to extend the Network System Preference Pane?
  • Next by Date: Re: CFNetwork, round-robin DNS and IP failover
  • Previous by thread: Re: Is it possible to extend the Network System Preference Pane?
  • Next by thread: Re: CFNetwork, round-robin DNS and IP failover
  • Index(es):
    • Date
    • Thread