Windows: Only register primary IP Address in DNS

Hi,

if you want to change the IP Address (new Address is in the same subnet) a of Windows Server by a minimal downtime for the users?

In pure Active Directory domains this is not a problem because the server itself updates its A Record at the DNS server and the Active Directory replicates the entry immediately.
In large environments with a heterogeneous DNS structure the TTL of the DNS entry respectively of the DNS zone becomes very important, because the entry is cached for this time by the requesting server, so the time when the new DNS A record reaches  each DNS Server can take some time.

My approach is to add the new IP Address as a secondary IP Address to the Network interface of the server. But when you add the additional IP Address with the GUI , both addresses where registered in DNS. This is not what we want 🙁

Solution is to add the IP Address by the netsh command. netsh supports the skipassource option, which prevents Windows to use this address for outgoing connections and from registering the IP Address in DNS.

Example: The old IP Address is 10.254.34.1, the new address is 10.254.34.120.

In the first step add the new IP address as the secondary address of the interface and wait until the DNS knows both.


C:\>nslookup YourHostName
Server:  dns.domain.local
Address:  10.254.39.10

Name:    YourHostName.domain.local
Addresses:  10.254.34.1
            10.254.34.120

For the next 2 steps the server is temporary not reachable from the network!

The 2nd step is to delete the secondary address and set it as the primary address.  This can by done by GUI.

And the 3rd step is to add the old IP Address as the secondary address without the ability to register its address in DNS:

c:\>Netsh int ipv4 add address Ethernet 10.254.34.1 255.255.255.0 skipassource=true


c:\> netsh interface ipv4 show config

Configuration for interface "Ethernet"
    DHCP enabled:                         No
    IP Address:                           10.254.34.120
    Subnet Prefix:                        10.254.34.0/24 (mask 255.255.255.0)
    IP Address:                           10.254.34.1
    Subnet Prefix:                        10.254.34.0/24 (mask 255.255.255.0)
    Default Gateway:                      10.254.34.254
    Gateway Metric:                       1
    InterfaceMetric:                      10
    Statically Configured DNS Servers:    10.254.39.10
                                          10.254.40.10
    Register with which suffix:           Primary only

Wait until the DNS only return the new IP Address and then remove the secondary address from the interface.

Michael

Leave a Reply