Previous Section  < Day Day Up >  Next Section

Recipe 24.20. Simple Load Balancing with BIND

24.20.1 Problem

You have redundant mail, FTP, or web servers, and you would like to configure them to automatically share the load during times of heavy traffic.

24.20.2 Solution

Just give them all A records, using the same server alias for each IP address:

ftp   IN  A   192.168.0.4

      IN  A   192.168.0.5

      IN  A   192.168.0.6

www   IN  A   192.168.0.7

      IN  A   192.168.0.8

      IN  A   192.168.0.9

mail  IN  A   192.168.0.10

      IN  A   192.168.0.11

      IN  A   192.168.0.12

An alternate trick with mail servers is to give them all the same priority:

IN   MX   10      mail.mydomain.com.

IN   MX   10      mail1.mydomain.com.

IN   MX   10      mail2.mydomain.com.

   

....

   

mail       IN      A          192.168.0.4

mail1      IN      A          192.168.0.5

mail2      IN      A          192.168.0.6

24.20.3 Discussion

Because of caching, you'll never get a perfect balance, but it's simple to set up, and works pretty well.

24.20.4 See Also

    Previous Section  < Day Day Up >  Next Section