Re: adding/removing DNS servers in Mac OS X
Re: adding/removing DNS servers in Mac OS X
- Subject: Re: adding/removing DNS servers in Mac OS X
- From: Allan Nathanson <email@hidden>
- Date: Thu, 14 Mar 2002 13:54:37 -0500
On Thursday, March 14, 2002, at 01:25 PM, Josh Graessley wrote:
On 3/14/02 8:51 AM, "Wade Williams" <email@hidden> wrote:
I suppose that I could have code that added the new name servers to
"/etc/resolve.conf" and then remove them when the connection goes down,
but I'm not sure that that's the correct way to do things in Mac OS X
and/or Darwin. I think you're supposed to talk to NetInfo, or possibly
the System Configuration Framework.
Some VPN clients I've seen do exactly that, and that's the only solution
I
know of that would work on Darwin.
I don't think this will work on Darwin. lookupd reads its configuration
out
of netinfo or the system configuration framework. resolve.conf is
overwritten as the result of changes to the data in one of those
locations.
The result is that any change in the real source of the configuration
results in resolve.conf getting overwritten. I think lookupd never reads
resolve.conf, resolve.conf is just written for tools like nslookup that
read
the file to get the current configuration.
If someone knows more, please correct me where I'm wrong.
Consider yourself corrected :-)
lookupd (and the resolver libraries) look to the /etc/resolv.conf file
first. If the file is not present then the configuration information in
NetInfo will be consulted.
As to who things "work"... A handful of configd plugins pull together the
various sources of DNS configuration information (manual settings, DHCP
derived settings, PPP derived settings), figure out which configuration
should be active (based on which interface is deemed "primary"), and the
/etc/resolv.conf file is updated. After the file has been updated we give
a kick to lookupd to tell it that a new configuration is available.
- Allan
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.