<p>I'm using an Ubuntu 8.04 (x86_64) machine to connect to my employer's Cisco VPN. (The client didn't compile out of the box, but I found <a href="http://projects.tuxx-home.at/?id=cisco_vpn_client" rel="nofollow noreferrer">patches to update the client to compile on kernels released in the last two years</a>.) This all works great, until my DHCP client decides to renew its lease and updates /etc/resolv.conf, replacing the VPN-specific name servers with my general network servers.</p>

<p>Is there a good way to prevent my DHCP client from updating /etc/resolv.conf while my VPN is active?</p>

If you are running without NetworkManager handling the connections, use the resolvconf package to act as an intermediary to programs tweaking /etc/resolv.conf:
```
sudo apt-get install resolvconf
```
If you are using NetworkManager it will handle this for you, so get rid of the resolvconf package:
```
sudo apt-get remove resolvconf
```
I found out about this when setting up vpnc on Ubuntu last week. A search for
```
vpn resolv.conf
```
on ubuntuforums.org has 250 results, many of which are very related!