DHCP and DNS

May 6th, 2005

There’s a problem when you’re running a read-only filesystem and you need to get a DHCP lease. /etc/resolv.conf stores the DNS server addresses, which is on the read-only partition. One solution is to remount the partition read-write, get the lease, then remount read-only. There are a couple of disadvantages to this though: First, it’s mounted readonly for a reason - the Compact Flash cards only have a finite number of writes to the same block before they become b0rked. Second, pump (our dhclient) runs as a daemon, so if a lease runs out, it needs to re-write to /etc/resolv.conf, and at that stage we don’t know it’s happening.
At the moment, I’m telling it to ignore DNS, so Murray is having to configure DNS addresses manually on his clients. Bad. So, I figure, let’s make /etc/resolv.conf a symlink to /tmp/resolv.conf. /tmp is a ram-disk, so it can be read and written as often as it likes. A simple script can be written to run at startup to put defaults in to /tmp/resolv.conf (the CRCnet DNS servers). This way the change should be transparent to anything that is running already, and we get the added benefit of being able to get DNS addresses via DHCP, and use these addresses in our proxyDNS system.

Entry Filed under: 420 General

Leave a Comment

hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

May 2005
M T W T F S S
« Apr   Jun »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Most Recent Posts