sonic-buildimage/files/image_config/interfaces
Oleksandr Ivantsiv d1fa414f1b
Clear DNS configuration received from DHCP during networking reconfiguration in Linux. (#13516) (#13695)
- Why I did it
fixes #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.
2023-02-10 09:11:05 -08:00
..
init_interfaces [sonic boot] disable dhcp during boot up, until updategraph service is running (#2316) 2018-11-29 08:34:22 -08:00
interfaces-config.service [services] introduce sonic.target (#5705) 2021-02-25 14:26:24 +02:00
interfaces-config.sh Clear DNS configuration received from DHCP during networking reconfiguration in Linux. (#13516) (#13695) 2023-02-10 09:11:05 -08:00
interfaces.j2 Upgrade to ifupdown2 3.0.0 with a patch to fix using broadcast addresses 2021-08-12 23:18:01 -07:00