I\'m trying to get the my dns server IP using using libresolv
framework , but all I get is \"0.0.0.0\"
-(void) getDns
{
res_init();
for
You are not resolving anything, you are just printing the address stored in some variable. You actually need to call res_query
or res_search
. But on iOS, you're better off with using the CFHost* methods, like in this question. There's also sample code from Apple (search the MyResolveNameToAddress
function).
Update after understanding the question: According to this question you cannot access the /etc/resolv.conf
file (permissions). But according to this question you might succeed by using the SystemConfigFramework but I've got no idea whether it works on iOS (the framework exists, but whether that information is exposed I don't know).