NetworkManager

Karl Auer kauer at biplane.com.au
Tue Oct 7 13:36:04 UTC 2008


On Tue, 2008-10-07 at 00:05 -0300, Derek Broughton wrote:
> > search domain, close. Result - resolv.conf has the new domain in it.
> > dhclient was not involved.
> 
> How do you know?

Because the process ID of dhclient did not change as it does if
NetworkManager runs it, and because I looked at /sbin/dhclient-script.

> > I do know where it's saved (at least the search domains) - it is saved
> > in /etc/resolv.conf. Try it.
> 
> No, it isn't.  /etc/resolv.conf is rewritten _completely_ every time
> dhclient runs.  It's a result, it's not the place the DNS config is saved.

Sorry, bad word to use, "saved". I don't know where Network Manager
stores it's version of reality. What I do know is that if you choose
"manual configuration" and change the search domains, they will be
written into /etc/resolve.conf. Right under the message saying the file
was modified by Network Manager...

NetworkManager may well also store that information elsewhere... but I
really don't think it does. It doesn't need to store it anywhere else,
and it's not a bad design to use the relevant system files directly.
Host info in/etc/hosts, nameserver info in /etc/resolv.conf. But where
does it store the interface info? Ah, now that's a mystery. We know it
looks at /etc/network/interfaces to work out what it should NOT do.
 
> Even if the network setting control module puts the domain there itself,
> that's not where the setting is saved that the control module reads,
> because dhclient is going to overwrite it.

The "network setting control module" DOES get the information
from /etc/resolv.conf. You can test this very easily by modifying
resolv.conf and doing a "manual configuration" - your changes will be
visible in the dialogue. And if you change those details in the
dialogue, they will be written back to /etc/resolv.conf.

And the DHCP client does indeed overwrite /etc/resolv.conf, but that's
not the whole story, I think. Looking at /sbin/dhclient-script, it seems
the DHCP client only concerns itself with the nameservers. That means
that NetworkManager is grabbing the search domains from somewhere and
adding them to resolv.conf. About the only place it could be getting the
search domain information is from the DHCP client leases file. So again,
I don't think it needs any separate stored copy of the information.

We've moved some distance from my original question, but learned a lot
along the way :-)

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)                   +61-2-64957160 (h)
http://www.biplane.com.au/~kauer/                  +61-428-957160 (mob)

GPG fingerprint: DD23 0DF3 2260 3060 7FEC 5CA8 1AF6 D9E3 CFEE 6B28

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20081008/663f96b6/attachment.sig>


More information about the ubuntu-users mailing list