2

I would like to set up load balancing for my website using DNS round robin.

My DNS is managed by my own CentOS 6 server running bind.

I added the following into my zone file:

@                               IN      NS              ns1.mydns.ch.
@                               IN      NS              ns2.mydns.ch. 
@                               IN      MX      10      mail1.mydomain.ch.
@                               IN      A               10.10.10.01
                                IN      A               10.10.10.02
www                             IN      CNAME           mydomain.ch.

However, when I run nslookup mydomain.ch I still only get the first IP.

What I would like to see is both IPs, with the order randomized.

How can I modify my zone file to accomplish this?

user788171
  • 279
  • 1
  • 5
  • 12
  • So the records are correct, the issue was I was editing the wrong file, I had to edit the signed file since we got DNSSEC. – user788171 Nov 21 '14 at 18:48

1 Answers1

1

The two A-records seem to be correct. That's the way to do rounud-robin.

Have you increased the SOA serial number, reloaded the zone and has it propagated to the slave? For testing it's best to avoid any intermediate nameservers and query the primary NS directly:

dig a mydomain.ch. @ns1.mydns.ch.

That will talk directly to your nameserver. If you use just a plan nslookup or dig without specifying the NS it will probably talk to your local NS that may do caching and not return the most recent data.

MLu
  • 23,798
  • 5
  • 54
  • 81