Skip to content

[action] [PR:13516] Clear DNS configuration received from DHCP during networking reconfiguration in Linux.#13686

Merged
mssonicbld merged 1 commit intosonic-net:202211from
mssonicbld:cherry/202211/13516
Feb 16, 2023
Merged

[action] [PR:13516] Clear DNS configuration received from DHCP during networking reconfiguration in Linux.#13686
mssonicbld merged 1 commit intosonic-net:202211from
mssonicbld:cherry/202211/13516

Conversation

@mssonicbld
Copy link
Collaborator

No description provided.

…uration in Linux. (sonic-net#13516)

- Why I did it
fixes sonic-net#12907

When the management interface IP address configuration changes from dynamic to static the DNS configuration (retrieved from the DHCP server) in /etc/resolv.conf remains uncleared. This leads to a DNS configuration pointing to the wrong nameserver. To make the behavior clear DNS configuration received from DHCP should be cleared.

- How I did it
Use resolvconf package for managing DNS configuration. It is capable of tracking the source of DNS configuration and puts the configuration retrieved from the DHCP servers into a separate file. This allows the implementation of DNS configuration cleanup retrieved from DHCP during networking reconfiguration.

- How to verify it
Ensure that the management interface has no static configuration.
Check that /etc/resolv.conf has DNS configuration.
Configure a static IP address on the management interface.
Verify that /etc/resolv.conf has no DNS configuration.
Remove the static IP address from the management interface.
Verify that /etc/resolv.conf has DNS configuration retrieved form DHCP server.
@mssonicbld
Copy link
Collaborator Author

Original PR: #13516

@mssonicbld mssonicbld merged commit 5ef488f into sonic-net:202211 Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants