How to get the list of current DNS servers on iPhone?
How to get the list of current DNS servers on iPhone?
- Subject: How to get the list of current DNS servers on iPhone?
- From: Alex Curylo <email@hidden>
- Date: Sun, 11 Oct 2009 21:03:05 -0700
So I've got this code that does asynchronous DNS resolution using the
ares library that I need to port to the iPhone. Getting the list of
DNS servers on the desktop is straightforward,
SCDynamicStoreContext context = {0, NULL, NULL, NULL, NULL};
SCDynamicStoreRef store = SCDynamicStoreCreate(NULL,
CFSTR("init_by_defaults_systemconfiguration"), NULL, &context);
CFStringRef key = CFSTR("State:/Network/Global/DNS");
CFDictionaryRef dnsDict = SCDynamicStoreCopyValue(store, key);
CFArrayRef addresses = (CFArrayRef) CFDictionaryGetValue(dnsDict,
kSCPropNetDNSServerAddresses);
... but the SCDynamicStore APIs aren't available on the iPhone and
it's not immediately evident what an equivalent might be. Any
suggestions?
--
Alex Curylo -- email@hidden -- http://www.alexcurylo.com/
Optimists see the glass half full. Pessimists see the glass half empty.
Engineers see that the glass is twice as big as it needs to be.
_______________________________________________
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