Skip to content
Tech Shizz Logo

An Engineers Blog

  • TechShizz
  • blog

DNS Policy Load Balancing | Server 2016

Posted on February 23, 2021 By rich No Comments on DNS Policy Load Balancing | Server 2016

By default if we have multiple A records with the same name, the DNS server will round robin i.e alternate through each record returning the value of each DNS record. This is great but if we want more control over balancing the responses to different records we can use DNS Load Balancing Policy to distribute responses in the desired way.

#Add a DNS Zone
Add-DNSServerPrimaryZone -Name "loadbalance.com" -ReplicationScope Domain
#Add a Zone Scope called "Scope-Heavy"
Add-DNSServerZoneScope -ZoneName "loadbalance.com" -Name "Scope-Heavy"
#Add a  Zone Scope called "Scope-Light"
Add-DNSServerZoneScope -ZoneName "loadbalance.com" -Name "Scope-Light"
#Add some A records to each zone, with different IP addresses to which the load will be balanced accordingly
Add-DNSServerResourceRecord -ZoneName "loadbalance.com" -A -Name "www" -IPv4Address "192.168.1.11"
Add-DNSServerResourceRecord -ZoneName "loadbalance.com" -A -Name "www" -IPv4Address "192.168.1.12" -ZoneScope "Scope-Light"
Add-DNSServerResourceRecord -ZoneName "loadbalance.com" -A -Name "www" -IPv4Address "192.168.1.13" -ZoneScope "Scope-Heavy"
#Set a Policy, so that server 192.168.1.13 gets around 9 out of every 11 requests.
Add-DNSServerQueryResolutionPolicy -Name "LB-Policy" -Action ALLOW -Fqdn "EQ,*" -ZoneScope "loadbalance.com,1;Scope-Light,1;Scope-Heavy,9" -ZoneName "loadbalance.com"
#Check it applied
Get-DNSServerQueryResolutionPolicy -ZoneName "loadbalance.com"

Post navigation

❮ Previous Post: HTTP Error 503 when Single Sin On redirecting to ADFS Server After Re-Enabling Single Sign On
Next Post: Connecting to and Configuring Nano Servers ❯

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Subscribe to our newsletter!

Recent Posts

  • How to implement a lightning-fast ransomware playbook
  • How to achieve defence in depth in your business
  • How to implement a SecOps team phishing response plan
  • How to block an Office 365 Sign-in correctly
  • Microsoft finally patched serious Exchange 0-day over a month old!

Recent Comments

    Archives

    • November 2022
    • July 2021
    • March 2021
    • February 2021

    Categories

    • Cyber Security
    • Uncategorized

    Meta

    • Log in
    • Entries feed
    • Comments feed
    • WordPress.org

    Copyright © 2023 .

    Theme: Oceanly News Dark by ScriptsTown