Say that I have two web servers, A and B. I want to set up DNS so that 83% of the time A's IP is returned first, and 17% B's IP is returned first.

Is there an enterprise grade DNS service that can help with that?

Edit: I know there are alternatives to doing this through DNS, and honestly so far DNS seems the worst way to go. Instead of using DNS I could use a load balancer (as many have suggested), or even more practical for my use case, alt-svc headers.

5 Answers 5


It's not possible with the DNS protocol on A records like it is on MX records. Weighted Round Robin through DNS is not the best practice and you should use load balancers instead

but if you really want:

it seems:

and that answer may also help you: https://serverfault.com/a/358256/214665


Short answer: Yes, but what you want is load balancing but you don't do that at the DNS level.

How this works is, you point your DNS to one IP and under this IP runs a service for load balancing, e.g. haproxy. There you can setup something like this:

Balance source
Server servera weight 83
Server serverb weight 17

This way 83% of the traffic gets routed to, 17% to

You didn't specifiy what service you want to balance. In case it is a webserver, Apaches mod_proxy provides load balancing functions: https://httpd.apache.org/docs/2.4/mod/mod_proxy_balancer.html

Edit: Just as addition: You can have a DNS A-record point to multiple IPs, but it doesn't support weight, only round robin.

  • Your last paragraph contains the essence of what I feared. I could also code my own DNS server or modify one of the open source ones, but that will be kind of risky for the customer.
    – dsign
    Sep 27, 2016 at 13:01
  • 1
    @dsign Well, in fact you can emulate weight with round robin like Vadim wrote. What his solution under 1. does is have a 75/25 load. If you do set 5 x IN A and 1 x IN A you essentially have a 17/83 split (or more precise, a 5/1 split).
    – Broco
    Sep 27, 2016 at 13:18
  1. Set multiple A-records like this:

    websrv  IN A
            IN A
            IN A
            IN A
  2. Set a load balancer with appropriate balancing rule in front of two DNS severs (one have record, another -

  3. Point A-record to a load balancer with appropriate balancing rule.
  4. I know nothing about this software, just have googled: http://simpledns.com/plugin-wrrobin
  • Thanks. This is supposed to be a minimally intrusive solution for some clients we will be experimenting with, this seems a bit overkill but may do.
    – dsign
    Sep 27, 2016 at 12:59

hello to perform this action you can use F5 GTM by Creating a pool of local DNS server, next change the order of priority .He will work like you say 83% / 17% . Of course it's not free....

  • Can you add a link?
    – dsign
    Sep 27, 2016 at 13:02

Like Broco said, it should not be performed at DNS level. Just like haproxy, you can use nginx for load balancing and nginx plus if you need enterprise support.



Basic config will be something like:

stream {
    upstream dns_servers {
        server weight=83;
        server weight=17;

    server {
        listen 53  udp;
        listen 53; #tcp
        proxy_pass dns_servers;
        error_log  /var/log/nginx/dns.log info;

So 83% of requests are sent to and 17% to

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