Previous INDEX Next
Sendmail Saga [III] Meddling Sendmail Saga [V] Loose Ends

DHCP clients and /etc/resolv.conf

To get the right nameservers into /etc/resolv.conf, I'd entered them by hand. I needed to make this automatic, once the DHCP clients had picked up their leased IP address from the DHCP server. On FreeBSD, this is achieved with an append directive in the /etc/dhclient.conf file (IP addresses omitted):

append domain-name-servers  primary.dns.server secondary.dns.server;

With Redhat Linux, the DHCP client is dhcpcd (the alternative is pump, but I wasn't using that). dhcpcd allows customisation by running a shell script called /etc/dhcpcd/dhcpcd.exe. Note that this file must be executable and have #!/bin/sh as its first line, otherwise it doesn't get run. I echo'd nameserver lines directly into the /etc/resolve.conf, like:

echo "nameserver primary.dns.server" >>/etc/resolv.conf
echo "nameserver secondary.dns.server" >>/etc/resolv.conf

Later, I found a easier way of setting the DNS servers, using the Alcatel router.

Previous INDEX Next
Sendmail Saga [III] Meddling Sendmail Saga [V] Loose Ends