Reputation: 5817
I need to link against libresolv library , and use it to find my dns ip.
Any advice on how to do that ?
Edit:
And how to find dns ip Using this library ?
Upvotes: 2
Views: 1699
Reputation: 92335
In Xcode3, on the left you should have a folder called "System Frameworks" or something like that were there are already other frameworks like Foundation.framework and UIKit.framework. Right-click on that folder, select "Add > Existing frameworks..." and select "libresolv.dylib" from the list.
Edit: I finally found out how to do this in Xcode4... on the left, in the navigator, select the left-most icon (Project, Command-1). In the tree below, click on the top-most item which is your project. Next, you need to select your target in the left column of the center view. Select the "Build Phases" tab. You now see a bunch of items that can be expanded. Expand the "Link Binary With Libraries" build phase, on the lower-left of that box is a "+" button ("Add items"). Click that, then select "libresolv.dylib" from the list. Phew. A lot harder to find than in Xcode3, IMHO.
Edit 2: If all you want to do is resolve the IP address of a hostname then you don't need to link libresolv (AFAIK). See 3 Ways to Resolve a Hostname in iOS for solutions and see the question How to perform DNS query on iOS.
Upvotes: 6