Take a look at this blog post I wrote a while ago, titled: How to Override DHCP Settings on a Fedora/CentOS/RHEL Linux Box.
There are 2 methods that I'm aware of where you can "append" your own DNS servers to the list provided by the DHCP server.
Method #1 - /etc/dhclient.conf
This first way is probably the most direct. The app, dhclient can make use of a config. file, /etc/dhclient.conf. To override the contents of the /etc/resolv.conf file simply create the file /etc/dhclient.conf:
interface "eth0" { supersede domain-name "local.home"; supersede domain-name-servers 192.168.0.5, 8.8.8.8, 8.8.4.4; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name; require subnet-mask, domain-name-servers; script "/sbin/dhclient-script"; }
This will result in the following /etc/resolv.conf file:
; generated by /sbin/dhclient-script search local.home nameserver 192.168.0.5 nameserver 8.8.8.8 nameserver 8.8.4.4
Method #2 - disable DNS propagation
The second approach is to disable dhclient’s ability to create the file /etc/resolv.conf in the first place. This makes use of another dhclient facility, called hooks. Specifically there are 2 hooks, enter & an exit hook. To disable the creation of /etc/resolv.conf, you can create a file called: /etc/dhclient-enter-hooks. The contents should be as follows:
make_resolv_conf() { # We don't want /etc/resolv.conf changed # So this is an empty function return 0 }
Make the file dhclient-enter-hooks executable:
$ chmod +x /etc/dhclient-enter-hooks
Additionally you’ll want to manually create a /etc/resolv.conf file, just like the one above. Doing it this way you’ll be creating a static /etc/resolv.conf file that won’t get rewritten each time the DHCP lease is renewed and/or changes in any way.
References