The variable $dns_changed was introduced along with the RENEW reason and is intended to only take affect with RENEW. This is done to keep the original behavior for reasons other than RENEW.
Related issues
Bug #16170: Incorrect logic for detection of DNS server change in cases where the ISP does not provide search domains in DHCPv6 renewal
Correct the DNS info change detection. Fix #16170
The variable $dns_changed was introduced along with the RENEW reason and
is intended to only take affect with RENEW. This is done to keep the
original behavior for reasons other than RENEW.