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 ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.