Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to add a line like:


to /etc/resolv.conf on Network Manager startup in Ubuntu?

share|improve this question

NetworkManager uses dhclient for DHCP leases, and you would be better off using dhclient hooks to change /etc/resolv.conf

You're probably running dhcp3-client on Ubuntu, I think it's the default with 8.10 and 9.04 at least.

If you are, your configuration file is in /etc/dhcp3/dhclient.conf

You can specify, per-interface modifications to /etc/resolv.conf


interface "wlan0" {
    supersede domain-name "";

That will generate an /etc/resolv.conf with:


man 5 dhclient.conf for more info.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.