| 
									
										
										
										
											2016-03-23 15:57:48 +00:00
										 |  |  | # loadbalance
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | ## Name
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | *loadbalance* - acts as a round-robin DNS loadbalancer by randomizing the order of A and AAAA records | 
					
						
							| 
									
										
										
										
											2017-07-24 08:24:53 -07:00
										 |  |  |  in the answer. | 
					
						
							| 
									
										
										
										
											2018-01-04 12:53:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Description
 | 
					
						
							| 
									
										
										
										
											2017-07-24 08:24:53 -07:00
										 |  |  |   | 
					
						
							|  |  |  |  See [Wikipedia](https://en.wikipedia.org/wiki/Round-robin_DNS) about the pros and cons on this | 
					
						
							|  |  |  |  setup. It will take care to sort any CNAMEs before any address records, because some stub resolver | 
					
						
							|  |  |  |  implementations (like glibc) are particular about that. | 
					
						
							| 
									
										
										
										
											2016-03-26 09:53:40 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-23 15:57:48 +00:00
										 |  |  | ## Syntax
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ~~~ | 
					
						
							| 
									
										
										
										
											2016-10-10 20:13:22 +01:00
										 |  |  | loadbalance [POLICY] | 
					
						
							| 
									
										
										
										
											2016-03-23 15:57:48 +00:00
										 |  |  | ~~~ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-10-10 20:13:22 +01:00
										 |  |  | * **POLICY** is how to balance, the default is "round_robin" | 
					
						
							| 
									
										
										
										
											2016-03-23 15:57:48 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## Examples
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-10 09:39:35 +02:00
										 |  |  | Load balance replies coming back from Google Public DNS: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ~~~ corefile | 
					
						
							|  |  |  | . { | 
					
						
							|  |  |  |     loadbalance round_robin | 
					
						
							|  |  |  |     proxy . 8.8.8.8 8.8.4.4 | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2016-03-23 15:57:48 +00:00
										 |  |  | ~~~ |