1

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.

3 Answers 3

0

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.

1
  • I wasn't able to track anything down on setting this via sysconfig, so I ended up just rolling it into a template in Chef and setting the nameservers via environment attributes.
    – Sammitch
    Jul 11, 2014 at 0:35
0

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.

1
  • 1
    Both of those options are overly complex, and I've already gotten simple resolvers up and running.
    – Sammitch
    Jul 9, 2014 at 22:41
0

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:

rotate_config() {
    echo "options rotate" >> /etc/resolv.conf
}

rotate_restore() {
    :
}

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 needs foo_config() and foo_restore().

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .