Recipe 24.20. Simple Load Balancing with BIND

 < Day Day Up > 

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

  • Chapter 3 of The BIND 9 Administrator Reference Manual (http://www.bind9.net/Bv9ARM.html)

     < Day Day Up > 


    Linux Cookbook
    Linux Cookbook
    ISBN: 0596006403
    EAN: 2147483647
    Year: 2004
    Pages: 434

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net