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)?

tweeks200
  • 351
  • 1
  • 3
  • 11

1 Answers1

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?

Pablo Martinez
  • 2,406
  • 17
  • 13
  • Thanks, this is what I'm looking for but do you know how to disable this if not using NetworkManager? – tweeks200 Jun 01 '16 at 01: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 01 '16 at 08:14
  • Will try the DHCP_SEND_HOSTNAME=no and see. Using NM is definitely an option is that doesnt work, thanks. – tweeks200 Jun 01 '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 02 '16 at 13:09