Thank you for your clarification.
I read here that I would be able to use NEAppProxyProvider - https://developer.apple.com/documentation/networkextension/neappproxyprovider to handle DNS queries.
After some more research, I stumbled upon NETransparentProxyManager, could I use this instead in combination with NETransparentProxyNetworkSettings to selectively handle DNS queries for certain hostnames?
My use case is this: Mac Client goes to "test.nonpublic.com" which does not exist within the public internet. (I will have a list of hostnames that should have their DNS requests intercepted)
This DNS request should be intercepted and the request should be sent through an established web socket connection to be handled.
All other DNS requests should not be handled by the application
Note: I only want to deal with DNS queries. No other network traffic is of concern to me as of this moment.
If this is the case, is there a code snippet you can provide that applies this configuration to NETransparentProxyManager?
If not, could you advise on how I should proceed to implement the behaviour I want?