That won’t work for code running inside the Network Extension provider, because NECP means that the extension ignores its own network. I talk about this more in A Peek Behind the NECP Curtain. Admittedly, that’s focused on interfaces, but the same applies for DNS resolvers.
There are two parts to this question. The first is: How does SwiftNIO use DNS? Cory answered this to confirm that it relies on the system resolver.
That leads to a second question: How can you change the behaviour of the system resolver on iOS? That’s very specific to Apple platforms, and so off-topic for Swift Forums. If you bounce over to Apple Developer Forums, I can help you out there.
Make sure to tag your thread with Network Extension so that I see it.