Renew DHCP from the command line on a Mac Can I run command sudo ipconfig set en0 DHCP as a standard user which shouldn't prompt for administrative username and password?
sudo ipconfig set $if DHCP &amp;&amp; echo OK


Where $if is your network interface. For example en0.

To find which interface you want to reset, you can see the output of ifconfig.

Or if you are lazy, you can just copy/paste this line, which will set $if to the interface which is used to access the Internet:

if=$(route -n get 0.0.0.0 2&gt;/dev/null | awk '/interface: / {print $2}') &amp;&amp; echo $if


So in the right order:

if=$(route -n get 0.0.0.0 2&gt;/dev/null | awk '/interface: / {print $2}') &amp;&amp; echo $if
sudo ipconfig set $if DHCP &amp;&amp; echo OK