[macOS] capture inbound DNS traffic using NEDNSProxyProvider

Is that possible to capture inbound DNS traffic using NEDNSProxyProvider using swift ?

I can see the outbound DNS traffic via handleNewUDPFlow. how to get the inbound DNS traffic?

I want to see all the DNS response in a macos device

Answered by DTS Engineer in 795364022
Is that possible to capture inbound DNS traffic using NEDNSProxyProvider … ?

No.

Hmmmm, well, let me be clear. A DNS proxy is designed to proxy requests made by DNS clients on the Mac (or the iOS device). It’s able to proxy outgoing TCP and UDP flows to port 53. It must read DNS queries from those flows and resolve them somehow. It may choose to send those queries to a server. Regardless, it must generate and return responses to such queries. Given that, it ‘sees’ both queries and responses. So, in one sense in can “capture inbound DNS traffic”. However, it can’t do that by passive monitoring, only by being actively involved in proxying those flows.

Share and Enjoy

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

Is that possible to capture inbound DNS traffic using NEDNSProxyProvider … ?

No.

Hmmmm, well, let me be clear. A DNS proxy is designed to proxy requests made by DNS clients on the Mac (or the iOS device). It’s able to proxy outgoing TCP and UDP flows to port 53. It must read DNS queries from those flows and resolve them somehow. It may choose to send those queries to a server. Regardless, it must generate and return responses to such queries. Given that, it ‘sees’ both queries and responses. So, in one sense in can “capture inbound DNS traffic”. However, it can’t do that by passive monitoring, only by being actively involved in proxying those flows.

Share and Enjoy

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

[macOS] capture inbound DNS traffic using NEDNSProxyProvider
 
 
Q