0

We have some HAProxy/keepalived clusters on CentOS7 and found that the virtual IPs managed with keepalived have registered in DNS. Does anyone know of a way to block dns registration for address registered with keepalived or to block DNS registration for an interface (while leaving DHCP on)?

1

Probably your CentOS servers are sending the hostname to the DHCP server and this is updating the DNS. One way to disable it is using nmcli (use ipv6.dhcp-send-hosname if you are using IPv6):

nmcli c m "System eth0" ipv4.dhcp-send-hostname no

You must set that configuration for all the connections (you can list them with nmcli c s -a).

I believe that should solve your issue but if you are still having the problem, could you please provide more information about the DHCP server?

  • Thanks, this is what I'm looking for but do you know how to disable this if not using NetworkManager? – tweeks200 Jun 1 '16 at 1:08
  • NetworkManager adds the DHCP_SEND_HOSTNAME=no setting to the /etc/sysconfig/network-scripts/ifcfg-ethX configuration file. I'm not sure if it will work with the network scripts, I haven't found any reference to that variable inside the scripts but you could try. If that does not work you could a) start using NetworkManager b) see if you can disable setting the hostname in the DHCP server c) maybe use iptables to block it? (just a crazy idea) – Pablo Martinez Jun 1 '16 at 8:14
  • Will try the DHCP_SEND_HOSTNAME=no and see. Using NM is definitely an option is that doesnt work, thanks. – tweeks200 Jun 1 '16 at 11:50
  • 1
    This did not work but I did confirm it works with NM on. I did find a bug report stating that with NM disabled this option also needs to be set, testing it now. DHCP_HOSTNAME=hostname – tweeks200 Jun 2 '16 at 13:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.