[CUWiN-Dev] adding nameservers to node config

David Young dyoung at pobox.com
Sat May 21 16:00:43 CDT 2005


On Sun, May 15, 2005 at 07:33:04PM -0500, Chase Phillips wrote:
> On Sun, 15 May 2005, tom wrote:
> 
> > I was at Mike Lehman's house today and I think I've refined his setup to the
> > point of usability. The trick is, his router doesn't give out DNS servers
> > along with a DHCP lease. Or if it does, it gives out the incorrect ones.
> > Mike's computer has a pair of DNS servers that it uses, and when I used
> > these I could connect to the Internet from my laptop through his node. I did
> > this by specifying the DNS servers on my own computer, though, not on the
> > node.
> 
> Might be worth finding out if the router is handing out DNS servers with
> the lease.  Maybe that could be fixed and the issue on the node would
> resolve itself?
> 
> > So the question becomes how to permanently add these nameservers to the
> > node. I believe they can just be added to /etc/resolv.conf, but I don't know
> > if that file persists after reboot. And a software upgrade would certainly
> > wipe them, but I think that's unavoidable and not necessarily too
> > problematic (we will just need to be careful about reinstating these servers
> > after an upgrade).
> 
> /etc/resolv.conf won't persist across reboots.  For that to work it will
> also need to be modified at /permanent/etc/resolv.conf.  (bryan will
> correct me if I've got the path wrong.)  /permanent is mounted read-only
> so you'll need to remount it read-write before making any modifications.
> He also recommends doing something like
> 
>   sh# cp /permanent/etc/resolv.conf /permanent/etc/garbage
> 
> after you've completed making changes to /permanent/etc/resolv.conf to
> workaround a known issue with storing data prior to shutting down a node.

Bryan, is this still a problem?  If not, it's important to try
to reproduce it in -current and file a PR if the problem persists.

ISTR the problem was softdep-related, and I disabled softdep as a
workaround.

> How recent is the software on Mike's node?  If it's less than a year old,
> it may be using dhcpselect.  When dhcpselect runs dhclient,
> /etc/resolv.conf will probably get overwritten.  In some cases, then,
> changes made to /etc/resolv.conf won't persist between reboots, either.

I don't fully understand what the problem is, but here are some pointers
for changing how dhclient treats DNS information:

make_resolve_conf in /sbin/dhclient-script overwrites resolv.conf.
(Note that we install a patched dhclient-script from
cuw/trunk/src/boot-image/extras/sbin/.)

If you don't want for resolv.conf to be overwritten, add a file
cuw/trunk/src/boot-image/extras/etc/dhclient-enter-hooks that does 'unset
new_domain_name_servers'.  (Note that you have to add the metainfo to
cuw/trunk/src/boot-image/extras/extraslog.)

Roughly, here is the way this should work: If a DHCP server tells us
DNS information, we should use that info unless the operator entered a
"manual override" through the web configurator.  If there is no DHCP
server, or if the server provides no DNS info, we should use sensible
defaults---an empty /etc/resolv.conf is not a sensible default. :-)

Dave

-- 
David Young             OJC Technologies
dyoung at ojctech.com      Urbana, IL * (217) 278-3933


More information about the CU-Wireless-Dev mailing list