Getting the Linux NetworkManager process to respect custom DNS server settings

I recently switched my work Desktop from Ubuntu to Fedora 11, and noticed that there are some new configuration options now that network intefaces are managed by the NetworkManager process. Two useful options are the ability to specify the DNS servers and search domains in the network-scripts files, and have those applied when a DHCP lease is acquired (this assumes you override the values provided by your DHCP server). To override the DNS servers and search domains, you can set the DNS1, DNS2 and DOMAIN variables in your favorite ifcfg-eth[0-9]+ script:

$ egrep ‘(DNS1|DNS2|DOMAIN)’ /etc/sysconfig/network-scripts/ifcfg-eth0
DNS1=192.168.1.1
DNS2=192.168.1.2
DOMAIN=”prefetch.net ops.prefetch.net”

Hopefully the NetworkManager is all it’s cracked up to be. Only time will tell of course. :)

2 thoughts on “Getting the Linux NetworkManager process to respect custom DNS server settings”

  1. To answer my own question… I found ripping out the network cable and plugining it back in again did the trick :-)

    I was using /etc/sysconfig/network-scripts/ifcfg-em1 to set the SEARCH domain. Basically the same as the above, but replace DOMAIN with SEARCH :-)

Leave a Reply

Your email address will not be published. Required fields are marked *