Default Dns server is loopback although the connection provide default servers

I'm trying to understand where do I get the dns server configuration from.

As I understand, if the file /etc/resolve.conf contain no servers, than it fallback to servers that are defined by the physical connection (Wi-Fi)

However, once I removed all dns servers from /etc/resolve.conf, I got that my DNS is configured to the loopback address (127.0.0.1) instead of what the connection provides.

nslookup       
> server                              
Default server: 127.0.0.1                      
Address: 127.0.0.1#53
Default server: ::1                         
Address: ::1#53
and Here's the the default dns servers from the Wi-Fi connection:

Here's what's configured by the interface :

Perhaps anyone can tell me why doesn't the default DNS server is selected to 10.196.X.X as provided by the connection (instead I get the loopback address)

I'm trying to understand where do I get the dns server configuration from.

Why? What do you plan to do with this info when you get it?

The reason this matters is because macOS has a very complicated DNS architecture, and so there isn’t such a thing as a single “DNS server configuration”. Rather, the DNS servers consulted for a request depend on the request itself [1].

Share and Enjoy

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

[1] There’s also DoH and DoT to consider, and DNS proxies, and probably more stuff that slips my mind right now.

I'm basically trying to start a vpn that changes the default DNS in my machine and replace it with my organization's local dns server.

I'd like to restore the dns when the vpn is off, So I was wondering where should I set it.

Is there any way I can read about macOS DNS architecture ?

I'm basically trying to start a vpn that changes the default DNS in my machine

Using which VPN transport? Something built-in to macOS? Like IKEv2? Or something you’re creating yourself, using a Network Extension provider?

Share and Enjoy

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

I am just adding onto this thread. When I am using IKEv2 VPN, it seems like I am losing access to any local resources like google where I can't do any DNS queries. I've specified the server manually when doing NSLookup to my WiFi DNS server and to the VPN DNS server and both of those return queries, it is just the loopback DNS that is having issues.

Do you know what causes this

Default Dns server is loopback although the connection provide default servers
 
 
Q