I connect to several networks throughout my workday as I go from site to site and have noticed the different DNS's these LANs use and handout to my system. If I'm on a "safe" LAN, I can trust the DNS's; however, there have been times that I must use untrusted sites... say a restaurant's free WiFi services. So, I want to understand better how my system updates settings. At each site, I notice that the DNS's listed in OSX's Network settings window change. And of course, when I'm on my home LAN, I see my familiar DNS's. I prefer to always use these DNS's when I'm at home.
Until now, I've trusted OSX to automatically and fully switch over to my Network when I'm at home, but a recent experience tells me that it isn't totally doing this. That is, it appears it is retaining previously acquired DNS's even though they aren't listed in the network settings under the DNS tab's list of DNS Servers.
I discovered this while setting up a new WiFi printer. I skimmed the printer manual and felt informed and savvy enough that I could just connect it's ethernet directly to my MacBook ethernet port via a patch cable. I accessed its configuration page to set it to connect to my WiFi. Before changing settings, I printed out the default network configuration information. I was surprised that it had already picked up a few things from my MacBook. I was already surprised that I didn't even have to manually configure the ethernet on my MacBook to the printer's default network. Anyhow, one of the settings that REALLY stood out was it had picked up a Secondary DNS server setting... an IP, which I'm familiar with from one of the LANs I frequently use.
The only conclusion I could come up with was that OSX is maintaining a history of DNS's to fallback on perhaps; however, I checked the network settings right away and found that neither AirPort or Eithernet listed the DNS server that was given to the printer.
Is there a command-line method of checking what DNSs my system is currently using?
OSX says it is using my DNS servers, but how can I be 100% certain? OSX obviously retained and even oddly handed out an IP to printer?