customize resolv.conf even when using network Manager

Having my laptop configured with dhcp through network manager (Ubuntu jaunty at the time of writing) is what I need in most networks. Often though, I need to contact hosts living under another domain. Traditionally, that’s wat the search option is in /etc/resolv.conf. It still is, but this file now gets configured dynamically through resolvconf, which in this case gets it data from network manager.

Hacking dhclient.conf won’t help, as the classic ifup ifdown scripts don’t touch this. Configuring extra search domains through Network Manager itself is no-go also, as you then need to configure static ip’s or at least static all of the dns entries which don’t get your dns server, domain name and search domain configured by dhcp also. What I needed, was adding search domains to resolv.conf.

Long story short, just add an additional search stanza line to /etc/resolvconf/resolv.conf.d/tail.

Getting Network-Manager to do what you want isn’t allways that flexible, and configuration options are limited when you hand over control to the nm daemon. but so far I manged to let it do most of what I needed, which isn’t all that special actually. I you wan’t to avoid NM taking control of you interface, just be sure to add an iface entry to /etc/network/interfaces, Network Manager takes only control of the interfaces which only have an auto line.