Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Reload config on manual DNS changes #785

Merged
merged 4 commits into from
Jun 14, 2024

Conversation

bradh352
Copy link
Member

@bradh352 bradh352 commented Jun 14, 2024

The NotifyIpInterfaceChange() method only notifies of automatic changes, such as via DHCP or interfaces going up or down. However, someone editing the DNS settings manually would not trigger a notification.

Use RegNotifyChangeKeyValue() to monitor HKLM\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters\Interfaces and HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces to pick up these changes.

This new check also works when using the OpenWatcom compiler as the symbols are available, so they have been enabled (though NotifyIpInterfaceChange() method is disabled for OpenWatcom still due to the linker libraries missing this symbol).

NOTE: it does appear that about 5 events get triggered for some reason, it doesn't seem to hurt anything, but it will actually cause it to re-read the configuration multiple times.

Fixes Issue: #761
Fix By: Brad House (@bradh352)

@bradh352 bradh352 merged commit 266599a into c-ares:main Jun 14, 2024
41 checks passed
@bradh352 bradh352 deleted the windnsnotify branch June 14, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant