Missing addresses of name servers

In our iOS networking related app for the app store (with network extension using packet tunnel provider), we are supposed to read the list of nameservers for the network. We use res_ninit function.

This function returns only 3 items (but in reality the network has more dns servers. In my case 5. Some ipv4 and some ipv6)

Looking at the header file at iOS 18.2 -> user/include/resolve.h, it shows that the __res_state struct has a maximum limit of 3 for the nsaddr_list array.

It seems that the reason the res_ninit function returns only 3 values is because of this. For our code to work correctly, it needs to know all the dns servers, but we only get partial results.

Is there any other api that can get us all the dns servers ?

Is there any other api that can get us all the dns servers?

No. Indeed, that question doesn’t really make sense given how DNS works on our systems. I cover the background to this in this thread.

With that in mind, let’s start with your requirements.

we are supposed to read the list of nameservers for the network.

Why? What’s your high-level goal here?

This is important because there might be a better approach, or your overall goal might be unsupported.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Missing addresses of name servers
 
 
Q