I've got an OpenStack cluster running with about 200 CentOS instances and I've gotten a complaint from my hosting provider that the DNS traffic is getting to be too much for their servers. To address this I've set up a couple bind resolver instances and would like to push these out via DHCP, but I haven't been able to find a way to ensure that the resolv.conf directive options rotate
gets either pushed out via dhcp, or can be set via some config file I assume would live in /etc/sysconfig
.
The
options rotate
setting is actually a client side setting, not something specified and distributed via the DHCP server.You are going to need to set the config file. I tend to set it resolv.conf deployed by Puppet but I think it can also be set in sysconfig.
Tim is correct that this is a client side config, however I am curious why you would want to do that ? what is your goal ? The reason is there might be other ways of achieving your goal,for example:
you can use LVS ( linux virtual server ) to build a cluster of dns servers and present a single ip to all your servers.
you can build a powerDNS recurser two node cluster with pacemaker and have this recurser use multiple name servers for its queries.
I've run back into this issue again, and after MUCH googling and raging I've found that the following will add
options rotate
, or literally anything else you want, to/etc/resolv.conf
without locking down the file or otherwise breaking functionality:Create put the following in the file
/etc/dhcp/dhclient.d/rotate.sh
:And then
chmod +x /etc/dhcp/dhclient.d/rotate.sh
.Any executable file like
/etc/dhcp/dhclient.d/*.sh
will be picked up by dhclient/NetworkManager, and requires two functions,*_config()
and*_restore()
which will be run when the interface goes up/down respectively.So
/etc/dhcp/dhclient.d/*.sh
needsfoo_config()
andfoo_restore()
.