So I bet you have seen what happens when you look up the Ip address for google.com .. you get five or six different IP addresses your client takes the first one…   for example

 

nslookup google.com

Non-authoritative answer:
Name:   google.com
Address: 74.125.225.145
Name:   google.com
Address: 74.125.225.144
Name:   google.com
Address: 74.125.225.148
Name:   google.com
Address: 74.125.225.147
Name:   google.com
Address: 74.125.225.146

 

Lets do that again:

Non-authoritative answer:
Name:   google.com
Address: 74.125.225.144
Name:   google.com
Address: 74.125.225.145
Name:   google.com
Address: 74.125.225.148
Name:   google.com
Address: 74.125.225.147
Name:   google.com
Address: 74.125.225.146

Notice how the order changes?  That is DNS round robin and your machine will use the first IP address it gets producing a type of poor mans (or womans) load balancer. It works great but how do you do it in DNS so that it works?

 

The best way is to load multiple A records inside DNS like this:

www.awesome.com        IN A  10.10.10.2

www.awesome.com        IN A 10.10.10.3

www.awesome.com        IN A 10.10.10.4

 

Another way is the following:

 

www.awesome      IN A 10.10.10.2

IN A 10.10.10.3

IN A 10.10.10.4

 

© 2012, Joseph Griffiths. All rights reserved.

Leave a Reply