How to pick available IP address from DNS resolution

GF 0 Reputation points
2023-07-03T06:40:18.2566667+00:00

Hi Experts:

In our company, we use Active Directory, and Windows Server 2019 as DNS servers, and the server's setting is as below:

(round robin or no scavenging seems the most important option)

[Image

](https://filestore.community.support.microsoft.com/api/images/20687eab-7221-40f4-9f47-a197ade09aa4?upload=true&fud_access=wJJIheezUklbAN2ppeDns8cDNpYs3nCYjgitr%2bfFBh2dqlqMuW7np3F6Utp%2fKMltnRRYFtVjOMO5tpbpW9UyRAwvLeec5emAPixgq9ta07Dgnp2aq5eJbnfd%2fU3qhn54o%2fdqQD2xNz0Y0vwKoybLf6XvJWKWJWPaM1nWrqyC%2boQRR%2fstjz4fA1vqreWClicN4TZ9CAyUenXrpiugug9PDIZzGYnIzqyZblC8Dt2eT%2bbvhG%2bPjvfOKtxVPyDgbaXp%2fDBdTHtlYKNx10Y6%2bJRw1zDqCBqsBbwphytzt39NF8qmgK5Sh%2bXAGwR2l2J0x2Goi%2bYBTGtPmo4KqsjlXPs6hyE%2bVO4baHdu%2f2hFxvanPax1CljNmLHfrndvyiXpummrHlu8jN77Xh2vznfyLB61w65rXhqDKRB%2b1aTfDrWXPe4%3d)

The users use both wired network (Data Point under desk) and WiFi to access internet.

They will acquire two IP addresses in different subnets by DHCP servers, and the DNS server in DHCP is above server.

Usually, the DNS server will generate 2x A records for a laptop by round robin. The first IP address will be the mostly recent registered. For example: if the laptop connects to WiFi first and then wired, the wired IP address will become the first IP address in the resolution sequence.

We usually Ping to test the connection to the laptop.

Then, the issue is , when network changed, the DNS server can't update the sequence accordingly.

For example: the laptop connects to WiFi first and then to wired, DNS server will put the wired IP address as the first one.

But if then the user goes to meeting room to have a meeting and unplugged the wired, the DNS server won't update the sequence and still keep the wired IP address as the first one in the resolution. In this case, other laptops can't ping it, because they only use the first IP address which resolved by the DNS server or in their own DNS cache.

I think there might be 4 ways to resolve this issue.

  1. Update the DNS server's refresh interval ASAP, if the IP address is not reachable, it should deleted the A record immediately. ( not sure if Windows Server 2019 has any mechanism to do this.) Or sending unregistration from the laptop to the DNS server when one IP address is unavailable ?
  2. On the DNS's client, try all IP addresses which resolved by the DNS server. ( It seems Ping command in CMD only use the first IP address resolved, I know some browsers like Chrome will try all IP addresses. )
  3. Clear the DNS cache on the Ping command running laptop ? (it seems not resolving if the DNS server didn't update)
  4. Use DHCP server to monitor the available IP address?

Is there any suggestion about the above issue? What we expect is that we can get the available IP address when we ping it .

Thanks very much

Best regards

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 44,766 Reputation points
    2023-07-03T10:44:25.48+00:00

    Hello George,

    Thank you for your question and for reaching out with your question today.

    To address the issue you described with DNS resolution and IP address changes, here are some suggestions:

    1. DNS Server Configuration: By default, DNS servers do not actively monitor the availability of IP addresses. However, you can configure the DNS server to automatically update the records based on the availability of IP addresses. This can be achieved by enabling the DNS scavenging feature. DNS scavenging allows the server to automatically remove stale records that are no longer in use. You can set the scavenging period and enable the refresh intervals accordingly.
    2. Client-Side DNS Resolution: In most cases, client devices rely on the DNS server to provide the IP addresses in the order they are returned. However, not all applications and utilities utilize all the IP addresses returned by DNS. As you mentioned, the ping command in CMD usually uses the first IP address. To overcome this limitation, you can modify your script or application to try all IP addresses returned by DNS, rather than relying on the default behavior.
    3. Clearing DNS Cache: If a client device has cached an incorrect IP address, clearing the DNS cache can help resolve the issue. On Windows, you can flush the DNS cache by running the command ipconfig /flushdns in an elevated Command Prompt. This clears the local DNS cache and forces the client device to query the DNS server for the most up-to-date IP addresses.
    4. DHCP Monitoring: DHCP servers manage the assignment of IP addresses to client devices. While they can monitor the availability of IP addresses, they are not directly responsible for DNS resolution. However, ensuring that your DHCP server is properly configured and has an appropriate lease time can help manage IP address assignments more efficiently.

    In summary, configuring DNS scavenging on the DNS server, modifying client-side DNS resolution behavior, clearing DNS cache on client devices, and ensuring DHCP server settings are properly configured can help address the issue you described. Consider implementing these steps based on your specific requirements and environment.

    I used AI provided by ChatGPT to formulate part of this response. I have verified that the information is accurate before sharing it with you.

    If the reply was helpful, please don’t forget to upvote or accept as answer.

    Best regards.


  2. GF 0 Reputation points
    2023-08-14T06:24:00.92+00:00

    Actually, I find that the cause might be the "round robin" rule.

    The WiFi and LAN network adapter will register an IP address separately, but the 2 adaptors won't work at at the same time ( the LAN will disable WiFi, and vice verse)

    But the resolution result will round robin between the 2 IP address, which means 50% possibility are not reachable.

    Could I turn off round robin feature?

    Will it make the latest registered IP address as the first one in the resolution sequence ? If it is ,then it reached our goal.

    Thanks again

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.