Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying to create an LVS DNS HA using CentOS 6.x:

  • Piranha GUI to configure the DNS
  • Pulse is the HA heart of CentOS LB
  • IPTables to configure marks on the packets since DNS uses TCP and UDP 53

After several days, I find that I can not figure out how to make it work - and I was hoping that someone has either the file avaiable along with all iptables rules necessary. Or if someone has already used some other OpenSource & Free software that allows to do DNS LB (not round robine DNS A records - that's not what the purpose of this exercise is for).

If anyone has successfully made named DNS under LVS with two or more real-servers within the pool, work, I would greatly appreciate if the configurations could be posted:

  • iptables rules to place

I am primarily looking for either Direct Server Return or NAT - either solution will work for me.

Thank you in advance.


share|improve this question
Have you attempted this setup? If so, you should post some more information about your setup (example configuration, network layout, obfuscated IP addresses). – Andy Shinn Jan 29 '13 at 18:48
Have a look at this as well. – gf_ May 6 at 7:40
DNS is already HA (or at least it should be). You shouldn't need LVS. What is the problem you are trying to solve? – dmourati May 6 at 8:04

You should be able to configure DNS load balancing pretty easily with LVS in DR mode. Personally I would use Ldirectord rather than Piranaha (which is old and buggy), but either should work.

Like you said you will need to configure your firewall mark for the correct TCP and UDP ports, then load balance all packets that are marked to your backend server(s). I assume you won't need persistence for DNS (wouldn't work for UDP anyway).

I think the step you are probably missing is to allow the backend servers to respond to the traffic you are sending - commonly know as the ARP problem. If you have Windows servers then use this method. Or for Linux the simplest method is to use an iptables redirect:

iptables -t nat -A PREROUTING -p tcp -d <VIP> -j REDIRECT

Its explained in more detail on page 21 of the quick start guide.

If you need any help, post your config and I'll take a look.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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