I'm looking to script a temporary DNS server change to override the DHCP response I get from the network. I've figured out I can use
networksetup but once we're done testing. Before I push to production, I figure I should know how to undo this.
How can I script to clear these changes and restore the settings the network provides now as if I never ran the following script?
networksetup -setdnsservers Wi-Fi "184.108.40.206" "220.127.116.11"
It's not feasible to save any the previous settings and I'm looking to remove the setting so that the actual new values can be retrieved from the network as opposed to saving what the settings were previously so I don't save an old value that is no longer correct.
Basically, I'm looking to
ipconfig /renew on macOS.