Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



macOS - DHCP lease ...
 
Share:
Notifications
Clear all

[Solved] macOS - DHCP lease renew

1 Posts
1 Users
0 Reactions
914 Views
 Hans
(@hans)
Famed Member Admin
Joined: 11 years ago
Posts: 2785
Topic starter  

Under Windows one has the option to renew or release the DNS lease with

ipconfig /release
ipconfig /renew

Something similar can be done under macOS as well.
For this you will first need to determine what network interface (adapter or device) you would like to use for this.

The easiest way to find that is using networksetup in terminal, like so:

networksetup -listallhardwareports

Which shows a list of network devices, like so (removed a few to keep the list readable):

$ networksetup -listallhardwareports

...

Hardware Port: Ethernet Adapter (en1)
Device: en1
Ethernet Address: 46:2a:52:ad:62:c7

Hardware Port: Ethernet Adapter (en2)
Device: en2
Ethernet Address: 46:3f:52:ad:62:c8

...

Hardware Port: Wi-Fi
Device: en0
Ethernet Address: f4:a4:88:5d:29:2e

...

You can use "ifconfig" for this, which is less convenient in my opinion, as it potentially will list a ton of network interfaces.

 

Now that you know what network device to use, we can release/renew the DHCP provided IP address like so (used "en0" as an example, sudo is required):

sudo ipconfig set en0 DHCP

Verify the details if you like:

ipconfig getpacket en0

This should produce a litst showing IP4 and IP6 addresses, subnet mask, DNS server, router, etc.


   
ReplyQuote
Share: