• 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
Re: Bypass Network System Preferences for DNS lookup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bypass Network System Preferences for DNS lookup


  • Subject: Re: Bypass Network System Preferences for DNS lookup
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 2 Jul 2010 21:04:10 +0200

Le 2 juil. 2010 à 19:33, Jens Alfke a écrit :

>
> On Jul 1, 2010, at 7:42 PM, Michael Jackson wrote:
>
>> Is there any way to bypass the system network preferences for DNS
>> servers to perform all DNS lookups from within a Cocoa app? For
>> example, I would like my app to always make DNS queries to a
>> particular pair of DNS servers.
>
> I’m pretty sure that’s not directly possible, since DNS lookups are done by a shared daemon process, not by individual apps.
>
> What you could do is incorporate direct DNS-lookup code into your app (I’m sure there are open-source libraries for it), use that to resolve the hostname to an IP address, and then use that IP address with your favorite networking APIs instead of the hostname. (If you’re using NSURLConnection, you’d need to transform the raw address into dotted-quad form, or the equivalent for IPv6.)

FWIW, dig can do that, as you can specify a server when you use it to test DNS query:

http://www.opensource.apple.com/source/bind9/bind9-31/bind9/bin/dig/

-- Jean-Daniel




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Bypass Network System Preferences for DNS lookup (From: Michael Jackson <email@hidden>)
 >Re: Bypass Network System Preferences for DNS lookup (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Bypass Network System Preferences for DNS lookup
  • Next by Date: NSMatrix setState and setSelectionFrom
  • Previous by thread: Re: Bypass Network System Preferences for DNS lookup
  • Next by thread: Re: Bypass Network System Preferences for DNS lookup
  • Index(es):
    • Date
    • Thread